diff --git a/Mixer.cpp b/Mixer.cpp index a311532..11f4188 100644 --- a/Mixer.cpp +++ b/Mixer.cpp @@ -450,6 +450,7 @@ void Mixer::newSession() // default view config mixing_.restoreSettings(); geometry_.restoreSettings(); + layer_.restoreSettings(); // empty session file name (does not save) sessionFilename_ = ""; diff --git a/Source.cpp b/Source.cpp index 0802d11..a6ee12e 100644 --- a/Source.cpp +++ b/Source.cpp @@ -245,6 +245,7 @@ void MediaSource::init() ImageShader *is = static_cast(surfacemix->shader()); if (is) is->stipple = 1.0; groups_[View::MIXING]->attach(surfacemix); + groups_[View::LAYER]->attach(surfacemix); if (mediaplayer_->duration() == GST_CLOCK_TIME_NONE) overlays_[View::MIXING]->attach( new Mesh("mesh/icon_image.ply") ); else diff --git a/View.cpp b/View.cpp index 4e728fe..8aef67f 100644 --- a/View.cpp +++ b/View.cpp @@ -65,17 +65,14 @@ void View::drag (glm::vec2 from, glm::vec2 to) MixingView::MixingView() : View(MIXING) { // read default settings - if ( Settings::application.views[View::MIXING].name.empty() ) { + if ( Settings::application.views[mode_].name.empty() ) { // no settings found: store application default - Settings::application.views[View::MIXING].name = "Mixing"; + Settings::application.views[mode_].name = "Mixing"; scene.root()->scale_ = glm::vec3(2.0f, 2.0f, 1.0f); saveSettings(); } - else - restoreSettings(); // Mixing scene background - Mesh *disk = new Mesh("mesh/disk.ply"); disk->setTexture(textureMixingQuadratic()); scene.bg()->attach(disk); @@ -112,7 +109,7 @@ void MixingView::grab (glm::vec2 from, glm::vec2 to, Source *s, std::pairgroup(View::MIXING); + Group *sourceNode = s->group(mode_); static glm::vec3 start_translation = glm::vec3(0.f); static glm::vec2 start_position = glm::vec2(0.f); @@ -218,14 +215,12 @@ void RenderView::draw() GeometryView::GeometryView() : View(GEOMETRY) { // read default settings - if ( Settings::application.views[View::GEOMETRY].name.empty() ) { + if ( Settings::application.views[mode_].name.empty() ) { // no settings found: store application default - Settings::application.views[View::GEOMETRY].name = "Geometry"; + Settings::application.views[mode_].name = "Geometry"; scene.root()->scale_ = glm::vec3(1.2f, 1.2f, 1.0f); saveSettings(); } - else - restoreSettings(); // Geometry Scene background Surface *rect = new Surface; @@ -269,7 +264,7 @@ void GeometryView::grab (glm::vec2 from, glm::vec2 to, Source *s, std::pairgroup(View::GEOMETRY); + Group *sourceNode = s->group(mode_); // remember source transform at moment of clic at position 'from' static glm::vec2 start_clic_position = glm::vec2(0.f); @@ -333,25 +328,25 @@ void GeometryView::grab (glm::vec2 from, glm::vec2 to, Source *s, std::pairscale_ = glm::vec3(1.0f, 1.0f, 1.0f); + Settings::application.views[mode_].name = "Layer"; + scene.root()->scale_ = glm::vec3(0.8f, 0.8f, 1.0f); + scene.root()->translation_ = glm::vec3(1.3f, 0.5f, 0.0f); saveSettings(); } - else - restoreSettings(); // Geometry Scene background Surface *rect = new Surface; + rect->shader()->color.a = 0.3f; scene.bg()->attach(rect); Mesh *persp = new Mesh("mesh/perspective_layer.ply"); persp->translation_.z = -0.1f; scene.bg()->attach(persp); - Frame *border = new Frame(Frame::SHARP_THIN); - border->color = glm::vec4( 0.8f, 0.f, 0.8f, 1.f ); + Frame *border = new Frame(Frame::ROUND_SHADOW); + border->color = glm::vec4( 0.8f, 0.f, 0.8f, 0.7f ); scene.bg()->attach(border); } @@ -363,6 +358,7 @@ LayerView::~LayerView() void LayerView::draw () { + // update rendering of render frame FrameBuffer *output = Mixer::manager().session()->frame(); if (output) @@ -383,6 +379,7 @@ void LayerView::zoom (float factor) z = CLAMP( z + 0.1f * factor, 0.2f, 10.f); scene.root()->scale_.x = z; scene.root()->scale_.y = z; + Log::Info("scale layer %f", scene.root()->scale_.x ); } @@ -391,7 +388,7 @@ void LayerView::grab (glm::vec2 from, glm::vec2 to, Source *s, std::pairgroup(View::LAYER); + Group *sourceNode = s->group(mode_); static glm::vec3 start_translation = glm::vec3(0.f); static glm::vec2 start_position = glm::vec2(0.f);