diff --git a/MediaPlayer.cpp b/MediaPlayer.cpp index cd2471d..46d93a1 100644 --- a/MediaPlayer.cpp +++ b/MediaPlayer.cpp @@ -439,6 +439,9 @@ void MediaPlayer::seekNextFrame() if (!enabled_ || isPlaying()) return; + if ( position_ == ( rate_ < 0.0 ? start_position_ : duration() ) ) + rewind(); + // step gst_element_send_event (pipeline_, gst_event_new_step (GST_FORMAT_BUFFERS, 1, ABS(rate_), TRUE, FALSE)); } @@ -840,7 +843,7 @@ bool MediaPlayer::fill_frame(GstBuffer *buf, MediaPlayer::FrameStatus status) } // give a position to EOS else { - frame_[write_index_].position = duration(); + frame_[write_index_].position = rate_ > 0.0 ? duration() : start_position_; } // unlock access to frame diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index f1be201..203ba21 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -398,20 +398,19 @@ void UserInterface::handleMouse() // // RIGHT Mouse button // - if ( ImGui::IsMouseDragging(ImGuiMouseButton_Right, 10.0f) ) { // right mouse drag => drag current view View::Cursor c = Mixer::manager().view()->drag( mouseclic[ImGuiMouseButton_Right], mousepos); setMouseCursor(io.MousePos, c); } - else if ( ImGui::IsMouseDown(ImGuiMouseButton_Right)) { - + else if ( ImGui::IsMouseDown(ImGuiMouseButton_Right)) + { Mixer::manager().unsetCurrentSource(); navigator.hidePannel(); // glm::vec3 point = Rendering::manager().unProject(mousepos, Mixer::manager().currentView()->scene.root()->transform_ ); - } + if ( ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Right) ) { Mixer::manager().view()->recenter(); @@ -504,7 +503,6 @@ void UserInterface::handleMouse() // only operate if the view didn't change if (view_drag == Mixer::manager().view()) { - // action on current source Source *current = Mixer::manager().currentSource(); if (current) @@ -1147,7 +1145,7 @@ void MediaController::Render() float spacing = ImGui::GetStyle().ItemInnerSpacing.x; - if (ImGui::Button(ICON_FA_FAST_BACKWARD)) + if (ImGui::Button(mp_->playSpeed() > 0 ? ICON_FA_FAST_BACKWARD :ICON_FA_FAST_FORWARD)) mp_->rewind(); ImGui::SameLine(0, spacing); @@ -1157,8 +1155,7 @@ void MediaController::Render() // display buttons Play/Stop depending on current playing mode if (media_playing_mode_) { - - if (ImGui::Button(ICON_FA_PAUSE " Pause")) + if (ImGui::Button(ICON_FA_PAUSE " Pause", ImVec2(100, 0))) media_playing_mode_ = false; ImGui::SameLine(0, spacing); @@ -1168,8 +1165,7 @@ void MediaController::Render() ImGui::PopButtonRepeat(); } else { - - if (ImGui::Button(ICON_FA_PLAY " Play ")) + if (ImGui::Button(mp_->playSpeed() < 0 ? ICON_FA_LESS_THAN " Play": ICON_FA_GREATER_THAN " Play", ImVec2(100, 0))) media_playing_mode_ = true; ImGui::SameLine(0, spacing);