began work on #119
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
TransformEffect::TransformEffect(Clip* c, const EffectMeta* em) : Effect(c, em) {
|
||||
enable_coords = true;
|
||||
enable_gizmos = true;
|
||||
|
||||
EffectRow* position_row = add_row("Position:");
|
||||
position_x = position_row->add_field(EFFECT_FIELD_DOUBLE, "posx"); // position X
|
||||
@@ -139,5 +140,9 @@ void TransformEffect::process_coords(double timecode, GLTextureCoords& coords, i
|
||||
// opacity
|
||||
float color[4];
|
||||
glGetFloatv(GL_CURRENT_COLOR, color);
|
||||
glColor4f(1.0, 1.0, 1.0, color[3]*(opacity->get_double_value(timecode)*0.01));
|
||||
glColor4f(1.0, 1.0, 1.0, color[3]*(opacity->get_double_value(timecode)*0.01));
|
||||
}
|
||||
|
||||
void TransformEffect::process_gizmos() {
|
||||
// TODO put gizmo code here
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ public:
|
||||
TransformEffect(Clip* c, const EffectMeta* em);
|
||||
void refresh();
|
||||
void process_coords(double timecode, GLTextureCoords& coords, int data);
|
||||
void process_gizmos();
|
||||
|
||||
EffectField* position_x;
|
||||
EffectField* position_y;
|
||||
|
||||
@@ -193,6 +193,7 @@ void EffectControls::deselect_all_effects(QWidget* sender) {
|
||||
}
|
||||
}
|
||||
}
|
||||
panel_sequence_viewer->viewer_widget->update();
|
||||
}
|
||||
|
||||
void EffectControls::open_effect(QVBoxLayout* layout, Effect* e) {
|
||||
|
||||
@@ -811,7 +811,6 @@ QTreeWidgetItem* Project::find_loaded_folder_by_id(int id) {
|
||||
const EffectMeta* get_meta_from_name(const QString& name, int type) {
|
||||
QVector<EffectMeta>& effect_list = (type == EFFECT_TYPE_VIDEO) ? video_effects : audio_effects;
|
||||
for (int j=0;j<effect_list.size();j++) {
|
||||
dout << effect_list.at(j).name << name << (effect_list.at(j).name == name);
|
||||
if (effect_list.at(j).name == name) {
|
||||
return &effect_list.at(j);
|
||||
}
|
||||
|
||||
+4
-1
@@ -223,7 +223,8 @@ Effect::Effect(Clip* c, const EffectMeta *em) :
|
||||
length(30),
|
||||
enable_shader(false),
|
||||
enable_coords(false),
|
||||
enable_superimpose(false),
|
||||
enable_superimpose(false),
|
||||
enable_gizmos(false),
|
||||
glslProgram(NULL),
|
||||
texture(NULL),
|
||||
isOpen(false),
|
||||
@@ -832,6 +833,8 @@ void Effect::process_audio(double, double, quint8*, int, int) {
|
||||
}*/
|
||||
}
|
||||
|
||||
void Effect::process_gizmos() {}
|
||||
|
||||
void Effect::redraw(double) {
|
||||
/*
|
||||
// run javascript
|
||||
|
||||
@@ -141,6 +141,7 @@ public:
|
||||
bool enable_shader;
|
||||
bool enable_coords;
|
||||
bool enable_superimpose;
|
||||
bool enable_gizmos;
|
||||
|
||||
int getIterations();
|
||||
void setIterations(int i);
|
||||
@@ -151,6 +152,7 @@ public:
|
||||
virtual void process_coords(double timecode, GLTextureCoords& coords, int data);
|
||||
virtual GLuint process_superimpose(double timecode);
|
||||
virtual void process_audio(double timecode_start, double timecode_end, quint8* samples, int nb_bytes, int channel_count);
|
||||
virtual void process_gizmos();
|
||||
public slots:
|
||||
void field_changed();
|
||||
private slots:
|
||||
|
||||
+13
-1
@@ -16,6 +16,7 @@
|
||||
#include "io/config.h"
|
||||
#include "debug.h"
|
||||
#include "io/math.h"
|
||||
#include "ui/collapsiblewidget.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QAudioOutput>
|
||||
@@ -457,7 +458,12 @@ GLuint ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio)
|
||||
// EFFECT CODE START
|
||||
double timecode = ((double)(playhead-c->get_timeline_in_with_transition()+c->get_clip_in_with_transition())/(double)c->sequence->frame_rate);
|
||||
for (int j=0;j<c->effects.size();j++) {
|
||||
process_effect(c, c->effects.at(j), timecode, coords, composite_texture, fbo_switcher, TA_NO_TRANSITION);
|
||||
Effect* e = c->effects.at(j);
|
||||
process_effect(c, e, timecode, coords, composite_texture, fbo_switcher, TA_NO_TRANSITION);
|
||||
|
||||
if (e->enable_gizmos && e->container->selected) {
|
||||
gizmos = e;
|
||||
}
|
||||
}
|
||||
|
||||
if (c->get_opening_transition() != NULL) {
|
||||
@@ -612,6 +618,8 @@ GLuint ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio)
|
||||
|
||||
void ViewerWidget::paintGL() {
|
||||
if (viewer->seq != NULL) {
|
||||
gizmos = NULL;
|
||||
|
||||
bool render_audio = (viewer->playing || rendering);
|
||||
bool loop = false;
|
||||
do {
|
||||
@@ -670,6 +678,10 @@ void ViewerWidget::paintGL() {
|
||||
drawTitleSafeArea();
|
||||
}
|
||||
|
||||
if (gizmos != NULL && !rendering) {
|
||||
gizmos->process_gizmos();
|
||||
}
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
} while (loop);
|
||||
|
||||
@@ -47,6 +47,7 @@ private:
|
||||
GLuint compose_sequence(QVector<Clip *> &nests, bool render_audio);
|
||||
GLuint draw_clip(QOpenGLFramebufferObject *clip, GLuint texture, bool clear);
|
||||
void process_effect(Clip* c, Effect* e, double timecode, GLTextureCoords& coords, GLuint& composite_texture, bool& fbo_switcher, int data);
|
||||
Effect* gizmos;
|
||||
private slots:
|
||||
void retry();
|
||||
void show_context_menu();
|
||||
|
||||
Reference in New Issue
Block a user