mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-07 00:10:00 +01:00
New action when clic on source symbol in Mixing or Layer views: open
editor in UI
This commit is contained in:
@@ -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) };
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user