mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
Setup icon (i,j coordinates in ImGui Toolkit) for each Source class, and
use this icon in GUI to indicate the type of class.
This commit is contained in:
@@ -512,6 +512,13 @@ DeviceConfigSet Device::getDeviceConfigs(const std::string &src_description)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
glm::ivec2 DeviceSource::icon() const
|
||||||
|
{
|
||||||
|
if ( device_.find("Screen") != std::string::npos )
|
||||||
|
return glm::ivec2(19, 1);
|
||||||
|
else
|
||||||
|
return glm::ivec2(2, 14);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ public:
|
|||||||
void setDevice(const std::string &devicename);
|
void setDevice(const std::string &devicename);
|
||||||
inline std::string device() const { return device_; }
|
inline std::string device() const { return device_; }
|
||||||
|
|
||||||
|
glm::ivec2 icon() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string device_;
|
std::string device_;
|
||||||
|
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ void ImGuiVisitor::visit (MediaSource& s)
|
|||||||
|
|
||||||
void ImGuiVisitor::visit (SessionSource& s)
|
void ImGuiVisitor::visit (SessionSource& s)
|
||||||
{
|
{
|
||||||
ImGuiToolkit::Icon(3,16);
|
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
|
||||||
ImGui::SameLine(0, 10);
|
ImGui::SameLine(0, 10);
|
||||||
ImGui::Text("Session File");
|
ImGui::Text("Session File");
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ void ImGuiVisitor::visit (SessionSource& s)
|
|||||||
|
|
||||||
void ImGuiVisitor::visit (RenderSource& s)
|
void ImGuiVisitor::visit (RenderSource& s)
|
||||||
{
|
{
|
||||||
ImGuiToolkit::Icon(19,1);
|
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
|
||||||
ImGui::SameLine(0, 10);
|
ImGui::SameLine(0, 10);
|
||||||
ImGui::Text("Rendering Output");
|
ImGui::Text("Rendering Output");
|
||||||
if ( ImGui::Button(IMGUI_TITLE_PREVIEW, ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
if ( ImGui::Button(IMGUI_TITLE_PREVIEW, ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
||||||
@@ -347,7 +347,7 @@ void ImGuiVisitor::visit (RenderSource& s)
|
|||||||
|
|
||||||
void ImGuiVisitor::visit (CloneSource& s)
|
void ImGuiVisitor::visit (CloneSource& s)
|
||||||
{
|
{
|
||||||
ImGuiToolkit::Icon(9,2);
|
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
|
||||||
ImGui::SameLine(0, 10);
|
ImGui::SameLine(0, 10);
|
||||||
ImGui::Text("Clone");
|
ImGui::Text("Clone");
|
||||||
if ( ImGui::Button(s.origin()->name().c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
if ( ImGui::Button(s.origin()->name().c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
||||||
@@ -356,7 +356,7 @@ void ImGuiVisitor::visit (CloneSource& s)
|
|||||||
|
|
||||||
void ImGuiVisitor::visit (PatternSource& s)
|
void ImGuiVisitor::visit (PatternSource& s)
|
||||||
{
|
{
|
||||||
ImGuiToolkit::Icon(12,5);
|
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
|
||||||
ImGui::SameLine(0, 10);
|
ImGui::SameLine(0, 10);
|
||||||
ImGui::Text("Pattern");
|
ImGui::Text("Pattern");
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ void ImGuiVisitor::visit (PatternSource& s)
|
|||||||
|
|
||||||
void ImGuiVisitor::visit (DeviceSource& s)
|
void ImGuiVisitor::visit (DeviceSource& s)
|
||||||
{
|
{
|
||||||
ImGuiToolkit::Icon(2,14);
|
ImGuiToolkit::Icon(s.icon().x, s.icon().y);
|
||||||
ImGui::SameLine(0, 10);
|
ImGui::SameLine(0, 10);
|
||||||
ImGui::Text("Device");
|
ImGui::Text("Device");
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,14 @@ MediaPlayer *MediaSource::mediaplayer() const
|
|||||||
return mediaplayer_;
|
return mediaplayer_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::ivec2 MediaSource::icon() const
|
||||||
|
{
|
||||||
|
if (mediaplayer_->isImage())
|
||||||
|
return glm::ivec2(2, 9);
|
||||||
|
else
|
||||||
|
return glm::ivec2(18, 13);
|
||||||
|
}
|
||||||
|
|
||||||
bool MediaSource::failed() const
|
bool MediaSource::failed() const
|
||||||
{
|
{
|
||||||
return mediaplayer_->failed();
|
return mediaplayer_->failed();
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ public:
|
|||||||
std::string path() const;
|
std::string path() const;
|
||||||
MediaPlayer *mediaplayer() const;
|
MediaPlayer *mediaplayer() const;
|
||||||
|
|
||||||
|
glm::ivec2 icon() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ public:
|
|||||||
Pattern *pattern() const;
|
Pattern *pattern() const;
|
||||||
void setPattern(int type, glm::ivec2 resolution);
|
void setPattern(int type, glm::ivec2 resolution);
|
||||||
|
|
||||||
|
glm::ivec2 icon() const override { return glm::ivec2(12, 5); }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PATTERNSOURCE_H
|
#endif // PATTERNSOURCE_H
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public:
|
|||||||
inline std::string path() const { return path_; }
|
inline std::string path() const { return path_; }
|
||||||
inline Session *session() const { return session_; }
|
inline Session *session() const { return session_; }
|
||||||
|
|
||||||
|
glm::ivec2 icon() const override { return glm::ivec2(3, 16); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
@@ -54,6 +56,8 @@ public:
|
|||||||
uint texture() const override;
|
uint texture() const override;
|
||||||
void accept (Visitor& v) override;
|
void accept (Visitor& v) override;
|
||||||
|
|
||||||
|
glm::ivec2 icon() const override { return glm::ivec2(0, 2); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|||||||
3
Source.h
3
Source.h
@@ -119,6 +119,7 @@ public:
|
|||||||
std::string _n;
|
std::string _n;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual glm::ivec2 icon() const { return glm::ivec2(12, 11); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// name
|
// name
|
||||||
@@ -190,6 +191,8 @@ public:
|
|||||||
inline void detach() { origin_ = nullptr; }
|
inline void detach() { origin_ = nullptr; }
|
||||||
inline Source *origin() const { return origin_; }
|
inline Source *origin() const { return origin_; }
|
||||||
|
|
||||||
|
glm::ivec2 icon() const override { return glm::ivec2(9, 2); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// only Source class can create new CloneSource via clone();
|
// only Source class can create new CloneSource via clone();
|
||||||
CloneSource(Source *origin);
|
CloneSource(Source *origin);
|
||||||
|
|||||||
@@ -1891,6 +1891,8 @@ void SourcePreview::Render(float width, bool controlbutton)
|
|||||||
source_->setActive(active);
|
source_->setActive(active);
|
||||||
ImGui::SetCursorPos(pos);
|
ImGui::SetCursorPos(pos);
|
||||||
}
|
}
|
||||||
|
ImGuiToolkit::Icon(source_->icon().x, source_->icon().y);
|
||||||
|
ImGui::SameLine(0, 10);
|
||||||
ImGui::Text("%s ", label_.c_str());
|
ImGui::Text("%s ", label_.c_str());
|
||||||
ImGui::Text("%d x %d %s", frame->width(), frame->height(), frame->use_alpha() ? "RGBA" : "RGB");
|
ImGui::Text("%d x %d %s", frame->width(), frame->height(), frame->use_alpha() ? "RGBA" : "RGB");
|
||||||
}
|
}
|
||||||
@@ -2047,13 +2049,9 @@ void Navigator::RenderNewPannel()
|
|||||||
// create preview
|
// create preview
|
||||||
if (update_new_source)
|
if (update_new_source)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
|
||||||
oss << Pattern::pattern_types[pattern_type];
|
|
||||||
|
|
||||||
glm::ivec2 res = GlmToolkit::resolutionFromDescription(Settings::application.source.ratio, Settings::application.source.res);
|
glm::ivec2 res = GlmToolkit::resolutionFromDescription(Settings::application.source.ratio, Settings::application.source.res);
|
||||||
oss << " (" << res.x << " x " << res.y << " px)";
|
new_source_preview_.setSource( Mixer::manager().createSourcePattern(pattern_type, res),
|
||||||
|
Pattern::pattern_types[pattern_type]);
|
||||||
new_source_preview_.setSource( Mixer::manager().createSourcePattern(pattern_type, res), oss.str());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Hardware
|
// Hardware
|
||||||
|
|||||||
Reference in New Issue
Block a user