mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Action manager follows View of restored action (user settings)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "tinyxml2Toolkit.h"
|
||||
#include "SessionVisitor.h"
|
||||
#include "SessionCreator.h"
|
||||
#include "Settings.h"
|
||||
|
||||
#include "ActionManager.h"
|
||||
|
||||
@@ -57,6 +58,8 @@ void Action::store(const std::string &label, uint64_t id)
|
||||
sessionNode->SetAttribute("label", label.c_str());
|
||||
// id indicates which object was modified
|
||||
sessionNode->SetAttribute("id", id);
|
||||
// view indicates the view when this action occured
|
||||
sessionNode->SetAttribute("view", (int) Mixer::manager().view()->mode());
|
||||
|
||||
// get session to operate on
|
||||
Session *se = Mixer::manager().session();
|
||||
@@ -150,6 +153,12 @@ void Action::restore(uint target, uint64_t id)
|
||||
std::string nodename = "H" + std::to_string(step_);
|
||||
XMLElement *sessionNode = xmlDoc_.FirstChildElement( nodename.c_str() );
|
||||
|
||||
// ask view to refresh, and switch to action view if user prefers
|
||||
int view = Settings::application.current_view ;
|
||||
if (Settings::application.action_history_follow_view)
|
||||
sessionNode->QueryIntAttribute("view", &view);
|
||||
Mixer::manager().setView( (View::Mode) view);
|
||||
|
||||
#ifdef ACTION_DEBUG
|
||||
Log::Info("Restore %s '%s' ", nodename.c_str(), sessionNode->Attribute("label"));
|
||||
#endif
|
||||
|
||||
@@ -375,6 +375,10 @@ void MediaPlayer::close()
|
||||
glDeleteBuffers(2, pbo_);
|
||||
pbo_size_ = 0;
|
||||
|
||||
#ifdef MEDIA_PLAYER_DEBUG
|
||||
Log::Info("MediaPlayer %s closed", std::to_string(id_).c_str());
|
||||
#endif
|
||||
|
||||
// unregister media player
|
||||
MediaPlayer::registered_.remove(this);
|
||||
}
|
||||
@@ -871,7 +875,7 @@ void MediaPlayer::execute_seek_command(GstClockTime target)
|
||||
else {
|
||||
seeking_ = true;
|
||||
#ifdef MEDIA_PLAYER_DEBUG
|
||||
Log::Info("MediaPlayer %s Seek %ld %f", std::to_string(id_).c_str(), seek_pos, rate_);
|
||||
Log::Info("MediaPlayer %s Seek %ld %.1f", std::to_string(id_).c_str(), seek_pos, rate_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +171,7 @@ struct Application
|
||||
bool pannel_stick;
|
||||
bool smooth_transition;
|
||||
bool smooth_cursor;
|
||||
bool action_history_follow_view;
|
||||
|
||||
// Settings of widgets
|
||||
WidgetsConfig widget;
|
||||
@@ -205,6 +206,7 @@ struct Application
|
||||
pannel_stick = false;
|
||||
smooth_transition = true;
|
||||
smooth_cursor = false;
|
||||
action_history_follow_view = false;
|
||||
current_view = 1;
|
||||
windows = std::vector<WindowConfig>(3);
|
||||
windows[0].name = APP_NAME APP_TITLE;
|
||||
|
||||
@@ -991,6 +991,8 @@ void UserInterface::RenderHistory()
|
||||
if ( ImGui::MenuItem( ICON_FA_REDO " Redo", CTRL_MOD "+Shift Z") )
|
||||
Action::manager().redo();
|
||||
|
||||
ImGui::MenuItem( ICON_FA_DIRECTIONS " Follow view", nullptr, &Settings::application.action_history_follow_view);
|
||||
|
||||
if ( ImGui::MenuItem( ICON_FA_TIMES " Close") )
|
||||
Settings::application.widget.history = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user