Various GUI terminology changes for unified wording and clarity

This commit is contained in:
brunoherbelin
2020-11-03 21:52:03 +01:00
parent ce7f30fa63
commit ec797f8d67
6 changed files with 40 additions and 25 deletions

View File

@@ -220,7 +220,7 @@ Device::Device()
g_list_free(devices); g_list_free(devices);
// Add config for plugged screen // Add config for plugged screen
src_name_.push_back("Screen"); src_name_.push_back("Screen capture");
src_description_.push_back(gst_plugin_vidcap); src_description_.push_back(gst_plugin_vidcap);
// Try to auto find resolution // Try to auto find resolution

View File

@@ -433,10 +433,9 @@ void ImGuiVisitor::visit (MediaSource& s)
ImGuiToolkit::Icon(18,13); ImGuiToolkit::Icon(18,13);
ImGui::SameLine(0, 10); ImGui::SameLine(0, 10);
ImGui::Text("Video File"); ImGui::Text("Video File");
if ( ImGui::Button(IMGUI_TITLE_MEDIAPLAYER, ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) {
UserInterface::manager().showMediaPlayer( s.mediaplayer());
}
} }
if ( ImGui::Button(IMGUI_TITLE_MEDIAPLAYER, ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
UserInterface::manager().showMediaPlayer( s.mediaplayer());
ImGuiToolkit::ButtonOpenUrl( SystemToolkit::path_filename(s.path()).c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0) ); ImGuiToolkit::ButtonOpenUrl( SystemToolkit::path_filename(s.path()).c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0) );
} }
@@ -445,6 +444,7 @@ void ImGuiVisitor::visit (SessionSource& s)
ImGuiToolkit::Icon(s.icon().x, s.icon().y); ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10); ImGui::SameLine(0, 10);
ImGui::Text("Session File"); ImGui::Text("Session File");
ImGui::Text("%s", SystemToolkit::base_filename(s.path()).c_str());
if (ImGuiToolkit::ButtonIcon(3, 2)) s.session()->setFading(0.f); if (ImGuiToolkit::ButtonIcon(3, 2)) s.session()->setFading(0.f);
float f = s.session()->fading(); float f = s.session()->fading();
@@ -537,14 +537,16 @@ void ImGuiVisitor::visit (NetworkSource& s)
{ {
ImGuiToolkit::Icon(s.icon().x, s.icon().y); ImGuiToolkit::Icon(s.icon().x, s.icon().y);
ImGui::SameLine(0, 10); ImGui::SameLine(0, 10);
ImGui::Text("Network connection"); ImGui::Text("Network stream");
ImGui::Text("Connection to %s", s.connection().c_str()); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(IMGUI_COLOR_STREAM, 0.9f));
ImGui::Text("%s", s.connection().c_str());
ImGui::PopStyleColor(1);
NetworkStream *ns = s.networkStream(); NetworkStream *ns = s.networkStream();
ImGui::Text(" - %s (%dx%d)\n - Network host %s:%d", NetworkToolkit::protocol_name[ns->protocol()], ImGui::Text(" - %s (%dx%d)\n - Server address %s", NetworkToolkit::protocol_name[ns->protocol()],
ns->resolution().x, ns->resolution().y, ns->IP().c_str(), ns->port()); ns->resolution().x, ns->resolution().y, ns->serverAddress().c_str());
if ( ImGui::Button("Reconnect", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) if ( ImGui::Button( ICON_FA_REPLY " Reconnect", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
{ {
// TODO : reload ? // TODO : reload ?
s.setConnection(s.connection()); s.setConnection(s.connection());

View File

@@ -78,6 +78,17 @@ glm::ivec2 NetworkStream::resolution() const
return glm::ivec2(config_.width, config_.height); return glm::ivec2(config_.width, config_.height);
} }
std::string NetworkStream::clientAddress() const
{
return config_.client_address + ":" + std::to_string(config_.port);
}
std::string NetworkStream::serverAddress() const
{
return streamer_.address;
}
void wait_for_stream_(UdpListeningReceiveSocket *receiver) void wait_for_stream_(UdpListeningReceiveSocket *receiver)
{ {
receiver->Run(); receiver->Run();

View File

@@ -39,8 +39,8 @@ public:
glm::ivec2 resolution() const; glm::ivec2 resolution() const;
inline NetworkToolkit::Protocol protocol() const { return config_.protocol; } inline NetworkToolkit::Protocol protocol() const { return config_.protocol; }
inline std::string IP() const { return config_.client_address; } std::string clientAddress() const;
inline uint port() const { return config_.port; } std::string serverAddress() const;
private: private:
// connection information // connection information

View File

@@ -1139,7 +1139,7 @@ void UserInterface::RenderPreview()
{ {
// Stop recording menu if main recorder already exists // Stop recording menu if main recorder already exists
if (rec) { if (rec) {
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0, 0.05, 0.05, 0.8f)); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(IMGUI_COLOR_RECORD, 0.8f));
if ( ImGui::MenuItem( ICON_FA_SQUARE " Stop Record", CTRL_MOD "R") ) { if ( ImGui::MenuItem( ICON_FA_SQUARE " Stop Record", CTRL_MOD "R") ) {
rec->stop(); rec->stop();
video_recorder_ = 0; video_recorder_ = 0;
@@ -1151,7 +1151,7 @@ void UserInterface::RenderPreview()
// detecting the absence of video recorder but the variable is still not 0: fix this! // detecting the absence of video recorder but the variable is still not 0: fix this!
if (video_recorder_ > 0) if (video_recorder_ > 0)
video_recorder_ = 0; video_recorder_ = 0;
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0, 0.05, 0.05, 0.9f)); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(IMGUI_COLOR_RECORD, 0.9f));
if ( ImGui::MenuItem( ICON_FA_CIRCLE " Record", CTRL_MOD "R") ) { if ( ImGui::MenuItem( ICON_FA_CIRCLE " Record", CTRL_MOD "R") ) {
FrameGrabber *fg = new VideoRecorder; FrameGrabber *fg = new VideoRecorder;
video_recorder_ = fg->id(); video_recorder_ = fg->id();
@@ -1205,7 +1205,7 @@ void UserInterface::RenderPreview()
} }
if (ImGui::BeginMenu("Stream")) if (ImGui::BeginMenu("Stream"))
{ {
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.05, 0.8, 1.0, 0.9f)); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(IMGUI_COLOR_STREAM, 0.9f));
if ( ImGui::MenuItem( ICON_FA_SHARE_ALT " Accept connections", NULL, &Settings::application.accept_connections) ) { if ( ImGui::MenuItem( ICON_FA_SHARE_ALT " Accept connections", NULL, &Settings::application.accept_connections) ) {
Streaming::manager().enable(Settings::application.accept_connections); Streaming::manager().enable(Settings::application.accept_connections);
} }
@@ -1214,12 +1214,12 @@ void UserInterface::RenderPreview()
{ {
static char dummy_str[512]; static char dummy_str[512];
sprintf(dummy_str, "%s", Connection::manager().info().name.c_str()); sprintf(dummy_str, "%s", Connection::manager().info().name.c_str());
ImGui::InputText("My network name", dummy_str, IM_ARRAYSIZE(dummy_str), ImGuiInputTextFlags_ReadOnly); ImGui::InputText("My network ID", dummy_str, IM_ARRAYSIZE(dummy_str), ImGuiInputTextFlags_ReadOnly);
std::vector<std::string> ls = Streaming::manager().listStreams(); std::vector<std::string> ls = Streaming::manager().listStreams();
if (ls.size()>0) { if (ls.size()>0) {
ImGui::Separator(); ImGui::Separator();
ImGui::MenuItem("Active connections", nullptr, false, false); ImGui::MenuItem("Active streams", nullptr, false, false);
for (auto it = ls.begin(); it != ls.end(); it++) for (auto it = ls.begin(); it != ls.end(); it++)
ImGui::Text(" %s", (*it).c_str() ); ImGui::Text(" %s", (*it).c_str() );
} }
@@ -1252,7 +1252,7 @@ void UserInterface::RenderPreview()
float r = ImGui::GetTextLineHeightWithSpacing(); float r = ImGui::GetTextLineHeightWithSpacing();
ImGui::SetCursorScreenPos(ImVec2(draw_pos.x + r, draw_pos.y + r)); ImGui::SetCursorScreenPos(ImVec2(draw_pos.x + r, draw_pos.y + r));
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE); ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0, 0.05, 0.05, 0.8f)); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(IMGUI_COLOR_RECORD, 0.8f));
ImGui::Text(ICON_FA_CIRCLE " %s", rec->info().c_str() ); ImGui::Text(ICON_FA_CIRCLE " %s", rec->info().c_str() );
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);
ImGui::PopFont(); ImGui::PopFont();
@@ -1264,9 +1264,9 @@ void UserInterface::RenderPreview()
ImGui::SetCursorScreenPos(ImVec2(draw_pos.x + width - 2.f * r, draw_pos.y + r)); ImGui::SetCursorScreenPos(ImVec2(draw_pos.x + width - 2.f * r, draw_pos.y + r));
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE); ImGuiToolkit::PushFont(ImGuiToolkit::FONT_LARGE);
if ( Streaming::manager().busy()) if ( Streaming::manager().busy())
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.05, 0.8, 1.0, 0.8f)); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(IMGUI_COLOR_STREAM, 0.8f));
else else
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.05, 0.8, 1.0, 0.2f)); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(IMGUI_COLOR_STREAM, 0.2f));
ImGui::Text(ICON_FA_SHARE_ALT_SQUARE); ImGui::Text(ICON_FA_SHARE_ALT_SQUARE);
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);
ImGui::PopFont(); ImGui::PopFont();
@@ -2118,10 +2118,10 @@ void Navigator::RenderNewPannel()
static const char* origin_names[4] = { ICON_FA_PHOTO_VIDEO " File", static const char* origin_names[4] = { ICON_FA_PHOTO_VIDEO " File",
ICON_FA_SYNC " Internal", ICON_FA_SYNC " Internal",
ICON_FA_COG " Generated", ICON_FA_COG " Generated",
ICON_FA_PLUG " External" ICON_FA_PLUG " Connected"
}; };
// TODO IMPLEMENT EXTERNAL SOURCES static const char* origin_names[3] = { ICON_FA_FILE " File", ICON_FA_SITEMAP " Internal", ICON_FA_PLUG " External" }; // TODO IMPLEMENT EXTERNAL SOURCES static const char* origin_names[3] = { ICON_FA_FILE " File", ICON_FA_SITEMAP " Internal", ICON_FA_PLUG " External" };
if (ImGui::Combo("Origin", &Settings::application.source.new_type, origin_names, IM_ARRAYSIZE(origin_names)) ) if (ImGui::Combo("##Origin", &Settings::application.source.new_type, origin_names, IM_ARRAYSIZE(origin_names)) )
new_source_preview_.setSource(); new_source_preview_.setSource();
// File Source creation // File Source creation
@@ -2140,7 +2140,7 @@ void Navigator::RenderNewPannel()
// Indication // Indication
ImGui::SameLine(); ImGui::SameLine();
ImGuiToolkit::HelpMarker("Create a source from a file:\n- Video (*.mpg, *mov, *.avi, etc.)\n- Image (*.jpg, *.png, etc.)\n- Vector graphics (*.svg)\n- vimix session (*.mix)\n\nEquivalent to dropping the file in the workspace."); ImGuiToolkit::HelpMarker("Create a source from a file:\n- video (*.mpg, *mov, *.avi, etc.)\n- image (*.jpg, *.png, etc.)\n- vector graphics (*.svg)\n- vimix session (*.mix)\n\n(Equivalent to dropping the file in the workspace)");
// if a file dialog future was registered // if a file dialog future was registered
if ( !fileImportFileDialogs.empty() ) { if ( !fileImportFileDialogs.empty() ) {
@@ -2254,7 +2254,7 @@ void Navigator::RenderNewPannel()
ImGui::SetCursorPosY(2.f * width_); ImGui::SetCursorPosY(2.f * width_);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if (ImGui::BeginCombo("##External", "Select source")) if (ImGui::BeginCombo("##External", "Select device"))
{ {
for (int d = 0; d < Device::manager().numDevices(); ++d){ for (int d = 0; d < Device::manager().numDevices(); ++d){
std::string namedev = Device::manager().name(d); std::string namedev = Device::manager().name(d);
@@ -2274,7 +2274,7 @@ void Navigator::RenderNewPannel()
// Indication // Indication
ImGui::SameLine(); ImGui::SameLine();
ImGuiToolkit::HelpMarker("Create a source with images from external devices or network."); ImGuiToolkit::HelpMarker("Create a source getting images from connected devices or machines;\n- webcams or frame grabbers\n- screen capture\n- vimix stream from connected machines");
} }

View File

@@ -50,9 +50,11 @@
#define IMGUI_TITLE_SHADEREDITOR ICON_FA_CODE " Code" #define IMGUI_TITLE_SHADEREDITOR ICON_FA_CODE " Code"
#define IMGUI_TITLE_PREVIEW ICON_FA_DESKTOP " Ouput" #define IMGUI_TITLE_PREVIEW ICON_FA_DESKTOP " Ouput"
#define IMGUI_TITLE_DELETE ICON_FA_BROOM " Delete?" #define IMGUI_TITLE_DELETE ICON_FA_BROOM " Delete?"
#define IMGUI_LABEL_RECENT_FILES " Recent files" #define IMGUI_LABEL_RECENT_FILES " Select recent"
#define IMGUI_RIGHT_ALIGN -3.5f * ImGui::GetTextLineHeightWithSpacing() #define IMGUI_RIGHT_ALIGN -3.5f * ImGui::GetTextLineHeightWithSpacing()
#define IMGUI_COLOR_OVERLAY IM_COL32(5, 5, 5, 150) #define IMGUI_COLOR_OVERLAY IM_COL32(5, 5, 5, 150)
#define IMGUI_COLOR_RECORD 1.0, 0.05, 0.05
#define IMGUI_COLOR_STREAM 0.05, 0.8, 1.0
#define IMGUI_NOTIFICATION_DURATION 1.5f #define IMGUI_NOTIFICATION_DURATION 1.5f
#ifdef APPLE #ifdef APPLE
#define CTRL_MOD "Cmd+" #define CTRL_MOD "Cmd+"