separated effect from UI
This commit is contained in:
@@ -56,8 +56,10 @@ void apply_audio_effects(Clip* clip, double timecode_start, AVFrame* frame, int
|
||||
timecode_end = timecode_start + bytes_to_seconds(nb_bytes, frame->channels, frame->sample_rate);
|
||||
|
||||
for (int j=0;j<clip->effects.size();j++) {
|
||||
EffectPtr e = clip->effects.at(j);
|
||||
if (e->is_enabled()) e->process_audio(timecode_start, timecode_end, frame->data[0], nb_bytes, 2);
|
||||
Effect* e = clip->effects.at(j).get();
|
||||
if (e->IsEnabled()) {
|
||||
e->process_audio(timecode_start, timecode_end, frame->data[0], nb_bytes, 2);
|
||||
}
|
||||
}
|
||||
if (clip->opening_transition != nullptr) {
|
||||
if (clip->media() != nullptr && clip->media()->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
@@ -839,7 +841,7 @@ void Cacher::OpenWorker() {
|
||||
}
|
||||
} else if (clip->media()->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
// opens file resource for FFmpeg and prepares Clip struct for playback
|
||||
FootagePtr m = clip->media()->to_footage();
|
||||
Footage* m = clip->media()->to_footage();
|
||||
|
||||
// byte array for retriving raw bytes from QString URL
|
||||
QByteArray ba;
|
||||
|
||||
@@ -114,7 +114,7 @@ void process_effect(Clip* c,
|
||||
bool& fbo_switcher,
|
||||
bool& texture_failed,
|
||||
int data) {
|
||||
if (e->is_enabled()) {
|
||||
if (e->IsEnabled()) {
|
||||
if (e->Flags() & Effect::CoordsFlag) {
|
||||
e->process_coords(timecode, coords, data);
|
||||
}
|
||||
@@ -159,7 +159,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
|
||||
GLuint final_fbo = params.main_buffer;
|
||||
|
||||
SequencePtr s = params.seq;
|
||||
Sequence* s = params.seq;
|
||||
long playhead = s->playhead;
|
||||
|
||||
if (!params.nests.isEmpty()) {
|
||||
@@ -194,7 +194,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
|
||||
// is the clip a "footage" clip?
|
||||
if (c->media() != nullptr && c->media()->get_type() == MEDIA_TYPE_FOOTAGE) {
|
||||
FootagePtr m = c->media()->to_footage();
|
||||
Footage* m = c->media()->to_footage();
|
||||
|
||||
// does the clip have a valid media source?
|
||||
if (!m->invalid && !(c->track() >= 0 && !is_audio_device_set())) {
|
||||
@@ -658,7 +658,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void compose_audio(Viewer* viewer, SequencePtr seq, int playback_speed, bool wait_for_mutexes) {
|
||||
void compose_audio(Viewer* viewer, Sequence* seq, int playback_speed, bool wait_for_mutexes) {
|
||||
ComposeSequenceParams params;
|
||||
params.viewer = viewer;
|
||||
params.ctx = nullptr;
|
||||
@@ -707,7 +707,7 @@ int64_t playhead_to_timestamp(Clip* c, long playhead) {
|
||||
return seconds_to_timestamp(c, playhead_to_clip_seconds(c, playhead));
|
||||
}
|
||||
|
||||
void close_active_clips(SequencePtr s) {
|
||||
void close_active_clips(Sequence* s) {
|
||||
if (s != nullptr) {
|
||||
for (int i=0;i<s->clips.size();i++) {
|
||||
Clip* c = s->clips.at(i).get();
|
||||
|
||||
@@ -59,7 +59,7 @@ struct ComposeSequenceParams {
|
||||
* In addition to clips, sequences also contain the playhead position so compose_sequence() knows which frame
|
||||
* to render.
|
||||
*/
|
||||
SequencePtr seq;
|
||||
Sequence* seq;
|
||||
|
||||
/**
|
||||
* @brief Array to store the nested sequence hierarchy
|
||||
@@ -263,7 +263,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms);
|
||||
*
|
||||
* Whether to wait for media to open or simply fail if the media is not yet open. This should usually be **FALSE**.
|
||||
*/
|
||||
void compose_audio(Viewer* viewer, SequencePtr seq, int playback_speed, bool wait_for_mutexes);
|
||||
void compose_audio(Viewer* viewer, Sequence *seq, int playback_speed, bool wait_for_mutexes);
|
||||
|
||||
/**
|
||||
* @brief Rescale a frame number between two frame rates
|
||||
@@ -400,6 +400,6 @@ int64_t playhead_to_timestamp(Clip *c, long playhead);
|
||||
*
|
||||
* The Sequence to close all clips on.
|
||||
*/
|
||||
void close_active_clips(SequencePtr s);
|
||||
void close_active_clips(Sequence* s);
|
||||
|
||||
#endif // RENDERFUNCTIONS_H
|
||||
|
||||
@@ -230,7 +230,12 @@ void RenderThread::paint() {
|
||||
ctx->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
void RenderThread::start_render(QOpenGLContext *share, SequencePtr s, const QString& save, GLvoid* pixels, int pixel_linesize, int idivider) {
|
||||
void RenderThread::start_render(QOpenGLContext *share,
|
||||
Sequence* s,
|
||||
const QString& save,
|
||||
GLvoid* pixels,
|
||||
int pixel_linesize,
|
||||
int idivider) {
|
||||
Q_UNUSED(idivider);
|
||||
|
||||
seq = s;
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
Effect* gizmos;
|
||||
void paint();
|
||||
void start_render(QOpenGLContext* share,
|
||||
SequencePtr s,
|
||||
Sequence *s,
|
||||
const QString &save = nullptr,
|
||||
GLvoid *pixels = nullptr,
|
||||
int pixel_linesize = 0,
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
GLuint ocio_lut_texture;
|
||||
QOpenGLShaderProgram* ocio_shader;
|
||||
|
||||
SequencePtr seq;
|
||||
Sequence* seq;
|
||||
int divider;
|
||||
int tex_width;
|
||||
int tex_height;
|
||||
|
||||
Reference in New Issue
Block a user