From d6101558a171dbd2390792ac1e78d09fc2c27711 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 6 Jul 2009 21:58:04 +0000 Subject: Merge xui-army-5 to viewer-2, includes layout, art, and color changes, also UI color refactoring and new FreeType font library on Linux. svn merge -r126038:126164 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/xui-army-5 --- indra/newview/lloutputmonitorctrl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/lloutputmonitorctrl.cpp') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index ff26707a56..196a86b29c 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -55,10 +55,10 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) mPower(0), mIsMuted(true) { - static LLUICachedControl output_monitor_muted_color("OutputMonitorMutedColor", LLColor4::orange); - static LLUICachedControl output_monitor_overdriven_color("OutputMonitorOverdrivenColor", LLColor4::red); - static LLUICachedControl output_monitor_normal_color("OutputMonitorNotmalColor", LLColor4::green); - static LLUICachedControl output_monitor_bound_color("OutputMonitorBoundColor", LLColor4::white); + static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); + static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); + static LLUIColor output_monitor_normal_color = LLUIColorTable::instance().getColor("OutputMonitorNotmalColor", LLColor4::green); + static LLUIColor output_monitor_bound_color = LLUIColorTable::instance().getColor("OutputMonitorBoundColor", LLColor4::white); static LLUICachedControl output_monitor_rects_number("OutputMonitorRectanglesNumber", 20); static LLUICachedControl output_monitor_rect_width_ratio("OutputMonitorRectangleWidthRatio", 0.5f); static LLUICachedControl output_monitor_rect_height_ratio("OutputMonitorRectangleHeightRatio", 0.8f); -- cgit v1.2.3 From 52aeaa32841e7d0b37abab0a2a2540c2be2f16b7 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 7 Jul 2009 00:53:05 +0000 Subject: Merge skinning-14 to viewer-2, including refactoring many floaters to register them with LLFloaterReg, support for introspection of ParamBlock based UI widgets to dump XML schema, splitting llfolderview.cpp into three separate files to unravel dependencies and skeleton for for LLListView widget. Resolved conflicts in these files: lldraghandle.h, lluictrl.h, llchiclet.cpp, llfolderview.h/cpp, lliinventorybridge.cpp, llpanelpicks.cpp, llviewermenu.cpp, floater_mute.xml, floater_preferences.xml, notifications.xml, panel_preferences_audio.xml, panel_preferences_graphics1.xml, panel_region_general.xml svn merge -r124961:126284 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-14 --- indra/newview/lloutputmonitorctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lloutputmonitorctrl.cpp') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 196a86b29c..60a86ed253 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -39,7 +39,7 @@ // viewer includes #include "llvoiceclient.h" -static LLDefaultWidgetRegistry::Register r("output_monitor"); +static LLDefaultChildRegistry::Register r("output_monitor"); // The defaults will be initialized in the constructor. LLColor4 LLOutputMonitorCtrl::sColorMuted; -- cgit v1.2.3 From 91f9835176d011e963a6df7d183a3f9c093a1989 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 10 Jul 2009 00:23:41 +0000 Subject: DEV-35118 Converted voice volume feedback icon on bottom tray to use real artwork. Converted LLOutputMonitorCtrl to use ParamBlocks to specify art. Added output_monitor.xml to specify art. Bottom bar gives volume feedback even when triggering voice with middle-mouse or keyboard binding. Reviewed with Richard. --- indra/newview/lloutputmonitorctrl.cpp | 165 +++++++++++++++++++++++----------- 1 file changed, 114 insertions(+), 51 deletions(-) (limited to 'indra/newview/lloutputmonitorctrl.cpp') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 60a86ed253..340cb8187d 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -39,41 +39,62 @@ // viewer includes #include "llvoiceclient.h" +// default options set in output_monitor.xml static LLDefaultChildRegistry::Register r("output_monitor"); // The defaults will be initialized in the constructor. -LLColor4 LLOutputMonitorCtrl::sColorMuted; -LLColor4 LLOutputMonitorCtrl::sColorOverdriven; -LLColor4 LLOutputMonitorCtrl::sColorNormal; +//LLColor4 LLOutputMonitorCtrl::sColorMuted; +//LLColor4 LLOutputMonitorCtrl::sColorOverdriven; +//LLColor4 LLOutputMonitorCtrl::sColorNormal; LLColor4 LLOutputMonitorCtrl::sColorBound; -S32 LLOutputMonitorCtrl::sRectsNumber = 0; -F32 LLOutputMonitorCtrl::sRectWidthRatio = 0.f; -F32 LLOutputMonitorCtrl::sRectHeightRatio = 0.f; +//S32 LLOutputMonitorCtrl::sRectsNumber = 0; +//F32 LLOutputMonitorCtrl::sRectWidthRatio = 0.f; +//F32 LLOutputMonitorCtrl::sRectHeightRatio = 0.f; + +LLOutputMonitorCtrl::Params::Params() +: image_mute("image_mute"), + image_off("image_off"), + image_on("image_on"), + image_level_1("image_level_1"), + image_level_2("image_level_2"), + image_level_3("image_level_3") +{ + draw_border = true; + name = "output_monitor"; + follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP); + mouse_opaque = false; +}; LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p) : LLView(p), mPower(0), - mIsMuted(true) + mIsMuted(true), + mImageMute(p.image_mute), + mImageOff(p.image_off), + mImageOn(p.image_on), + mImageLevel1(p.image_level_1), + mImageLevel2(p.image_level_2), + mImageLevel3(p.image_level_3) { - static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); - static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); - static LLUIColor output_monitor_normal_color = LLUIColorTable::instance().getColor("OutputMonitorNotmalColor", LLColor4::green); + //static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange); + //static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red); + //static LLUIColor output_monitor_normal_color = LLUIColorTable::instance().getColor("OutputMonitorNotmalColor", LLColor4::green); static LLUIColor output_monitor_bound_color = LLUIColorTable::instance().getColor("OutputMonitorBoundColor", LLColor4::white); - static LLUICachedControl output_monitor_rects_number("OutputMonitorRectanglesNumber", 20); - static LLUICachedControl output_monitor_rect_width_ratio("OutputMonitorRectangleWidthRatio", 0.5f); - static LLUICachedControl output_monitor_rect_height_ratio("OutputMonitorRectangleHeightRatio", 0.8f); + //static LLUICachedControl output_monitor_rects_number("OutputMonitorRectanglesNumber", 20); + //static LLUICachedControl output_monitor_rect_width_ratio("OutputMonitorRectangleWidthRatio", 0.5f); + //static LLUICachedControl output_monitor_rect_height_ratio("OutputMonitorRectangleHeightRatio", 0.8f); // IAN BUG compare to existing pattern where these are members - some will change per-widget and need to be anyway // sent feedback to PE // *TODO: it looks suboptimal to load the defaults every time an output monitor is constructed. - sColorMuted = output_monitor_muted_color; - sColorOverdriven = output_monitor_overdriven_color; - sColorNormal = output_monitor_normal_color; + //sColorMuted = output_monitor_muted_color; + //sColorOverdriven = output_monitor_overdriven_color; + //sColorNormal = output_monitor_normal_color; sColorBound = output_monitor_bound_color; - sRectsNumber = output_monitor_rects_number; - sRectWidthRatio = output_monitor_rect_width_ratio; - sRectHeightRatio = output_monitor_rect_height_ratio; + //sRectsNumber = output_monitor_rects_number; + //sRectWidthRatio = output_monitor_rect_width_ratio; + //sRectHeightRatio = output_monitor_rect_height_ratio; mBorder = p.draw_border; } @@ -89,6 +110,48 @@ void LLOutputMonitorCtrl::setPower(F32 val) void LLOutputMonitorCtrl::draw() { + // Copied from llmediaremotectrl.cpp + // *TODO: Give the LLOutputMonitorCtrl an agent-id to monitor, then + // call directly into gVoiceClient to ask if that agent-id is muted, is + // speaking, and what power. This avoids duplicating data, which can get + // out of sync. + LLPointer icon; + if (mIsMuted) + { + icon = mImageMute; + } + else if (mPower == 0.f) + { + icon = mImageOff; + } + else if (mPower < LLVoiceClient::OVERDRIVEN_POWER_LEVEL) + { + S32 icon_image_idx = llmin(2, llfloor((mPower / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 3.f)); + switch(icon_image_idx) + { + default: + case 0: + icon = mImageOn; + break; + case 1: + icon = mImageLevel1; + break; + case 2: + icon = mImageLevel2; + break; + } + } + else + { + // overdriven + icon = mImageLevel3; + } + + if (icon) + { + icon->draw(0, 0); + } + // // Fill the monitor with a bunch of small rectangles. // The rectangles will be filled with gradient color, @@ -98,41 +161,41 @@ void LLOutputMonitorCtrl::draw() // const int monh = getRect().getHeight(); const int monw = getRect().getWidth(); - int maxrects = sRectsNumber; - const int period = llmax(1, monw / maxrects, 0, 0); // "1" - min value for the period - const int rectw = llmax(1, llfloor(period * sRectWidthRatio), 0, 0); // "1" - min value for the rect's width - const int recth = llfloor(monh * sRectHeightRatio); + //int maxrects = sRectsNumber; + //const int period = llmax(1, monw / maxrects, 0, 0); // "1" - min value for the period + //const int rectw = llmax(1, llfloor(period * sRectWidthRatio), 0, 0); // "1" - min value for the rect's width + //const int recth = llfloor(monh * sRectHeightRatio); - if(period == 1 && rectw == 1) //if we have so small control, then "maxrects = monitor's_width - 2*monitor_border's_width - maxrects = monw-2; + //if(period == 1 && rectw == 1) //if we have so small control, then "maxrects = monitor's_width - 2*monitor_border's_width + // maxrects = monw-2; - const int nrects = mIsMuted ? maxrects : llfloor(mPower * maxrects); // how many rects to draw? - const int rectbtm = (monh - recth) / 2; - const int recttop = rectbtm + recth; - - LLColor4 rect_color; - - for (int i=1, xpos = 0; i <= nrects; i++) - { - // Calculate color to use for the current rectangle. - if (mIsMuted) - { - rect_color = sColorMuted; - } - else - { - F32 frac = (mPower * i/nrects) / LLVoiceClient::OVERDRIVEN_POWER_LEVEL; - // Use overdriven color if the power exceeds overdriven level. - if (frac > 1.0f) - frac = 1.0f; - rect_color = lerp(sColorNormal, sColorOverdriven, frac); - } + //const int nrects = mIsMuted ? maxrects : llfloor(mPower * maxrects); // how many rects to draw? + //const int rectbtm = (monh - recth) / 2; + //const int recttop = rectbtm + recth; + // + //LLColor4 rect_color; + // + //for (int i=1, xpos = 0; i <= nrects; i++) + //{ + // // Calculate color to use for the current rectangle. + // if (mIsMuted) + // { + // rect_color = sColorMuted; + // } + // else + // { + // F32 frac = (mPower * i/nrects) / LLVoiceClient::OVERDRIVEN_POWER_LEVEL; + // // Use overdriven color if the power exceeds overdriven level. + // if (frac > 1.0f) + // frac = 1.0f; + // rect_color = lerp(sColorNormal, sColorOverdriven, frac); + // } + + // // Draw rectangle filled with the color. + // gl_rect_2d(xpos, recttop, xpos+rectw, rectbtm, rect_color, TRUE); + // xpos += period; + //} - // Draw rectangle filled with the color. - gl_rect_2d(xpos, recttop, xpos+rectw, rectbtm, rect_color, TRUE); - xpos += period; - } - // // Draw bounding box. // -- cgit v1.2.3 From 8f7ec64899c54dcee6caa0307510cc4003ba7bdd Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 27 Jul 2009 17:56:26 +0000 Subject: Merged skinning-17 into viewer-2 for bug fixes. Commented out new IM window for now, not complete. Merging revisions 127913-128319 of svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-17 into D:\viewer-2.0.0-3, respecting ancestry --- indra/newview/lloutputmonitorctrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/lloutputmonitorctrl.cpp') diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index 340cb8187d..955f50caf5 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -52,7 +52,8 @@ LLColor4 LLOutputMonitorCtrl::sColorBound; //F32 LLOutputMonitorCtrl::sRectHeightRatio = 0.f; LLOutputMonitorCtrl::Params::Params() -: image_mute("image_mute"), +: draw_border("draw_border"), + image_mute("image_mute"), image_off("image_off"), image_on("image_on"), image_level_1("image_level_1"), -- cgit v1.2.3