New action when clic on source symbol in Mixing or Layer views: open

editor in UI
This commit is contained in:
brunoherbelin
2021-03-17 22:50:21 +01:00
parent ea211cb8ab
commit 2227c97a57
4 changed files with 33 additions and 1 deletions

View File

@@ -231,8 +231,13 @@ std::pair<Node *, glm::vec2> LayerView::pick(glm::vec2 P)
pick = { nullptr, glm::vec2(0.f) };
}
// pick a locked source; cancel pick
else if ( s->locked() )
else if ( s->locked() ) {
pick = { nullptr, glm::vec2(0.f) };
}
// pick the symbol: ask to show editor
else if ( pick.first == s->symbol_ ) {
UserInterface::manager().showSourceEditor(s);
}
}
else
pick = { nullptr, glm::vec2(0.f) };

View File

@@ -349,6 +349,10 @@ std::pair<Node *, glm::vec2> MixingView::pick(glm::vec2 P)
else if ( s->locked() ) {
pick = { nullptr, glm::vec2(0.f) };
}
// pick the symbol: ask to show editor
else if ( pick.first == s->symbol_ ) {
UserInterface::manager().showSourceEditor(s);
}
// pick on the mixing group rotation icon
else if ( pick.first == s->rotation_mixingroup_ ) {
s->mixinggroup_->setAction( MixingGroup::ACTION_ROTATE_ALL );

View File

@@ -57,6 +57,7 @@ using namespace std;
#include "FrameBuffer.h"
#include "MediaPlayer.h"
#include "MediaSource.h"
#include "SessionSource.h"
#include "PatternSource.h"
#include "DeviceSource.h"
#include "NetworkSource.h"
@@ -1521,6 +1522,27 @@ int UserInterface::RenderViewNavigator(int *shift)
return target_index;
}
void UserInterface::showSourceEditor(Source *s)
{
MediaSource *ms = dynamic_cast<MediaSource *>(s);
if (ms != nullptr) {
showMediaPlayer(ms->mediaplayer());
return;
}
CloneSource *cs = dynamic_cast<CloneSource *>(s);
if (cs != nullptr) {
Mixer::manager().setCurrentSource( cs->origin() );
return;
}
RenderSource *rs = dynamic_cast<RenderSource *>(s);
if (rs != nullptr) {
Settings::application.widget.preview = true;
return;
}
navigator.showPannelSource( Mixer::manager().indexCurrentSource() );
}
void UserInterface::showMediaPlayer(MediaPlayer *mp)
{
Settings::application.widget.media_player = true;

View File

@@ -152,6 +152,7 @@ public:
void StartScreenshot();
void showPannel(int id = 0);
void showSourceEditor(Source *s);
void showMediaPlayer(MediaPlayer *mp);
// TODO implement the shader editor