summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2014-08-22 11:45:34 -0500
committerBen Loftis <ben@harrisonconsoles.com>2014-08-22 11:51:20 -0500
commit74f313dd6b52c5bd36536d90e7b9e62b0679087b (patch)
treea25d093f1f85a3ab2850b9dc0a4a437d3736fef7 /gtk2_ardour
parenta7226133a990afa294339ffa735f9dee8eff97e4 (diff)
Rationalize ArdourButton and lots of associated theming issues.
ArdourButtons now have a "pushed" animation. The gradient is now implemented in the button, rather than providing 2 colors in the theme, which was burdensome. Lots of code cleanup in ArdourButton. Removed several unnecessary flags. Refactor more stuff into route_ui.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour3_ui_default.conf.in287
-rw-r--r--gtk2_ardour/ardour_button.cc351
-rw-r--r--gtk2_ardour/ardour_button.h51
-rw-r--r--gtk2_ardour/ardour_knob.cc4
-rw-r--r--gtk2_ardour/ardour_ui.cc12
-rw-r--r--gtk2_ardour/ardour_ui2.cc2
-rw-r--r--gtk2_ardour/ardour_ui_dialogs.cc7
-rw-r--r--gtk2_ardour/canvas_vars.h21
-rw-r--r--gtk2_ardour/editor.cc17
-rw-r--r--gtk2_ardour/editor_routes.cc10
-rw-r--r--gtk2_ardour/meter_strip.cc21
-rw-r--r--gtk2_ardour/meter_strip.h4
-rw-r--r--gtk2_ardour/mixer_strip.cc69
-rw-r--r--gtk2_ardour/mixer_strip.h4
-rw-r--r--gtk2_ardour/route_time_axis.cc5
-rw-r--r--gtk2_ardour/route_time_axis.h2
-rw-r--r--gtk2_ardour/route_ui.cc69
-rw-r--r--gtk2_ardour/route_ui.h4
18 files changed, 387 insertions, 553 deletions
diff --git a/gtk2_ardour/ardour3_ui_default.conf.in b/gtk2_ardour/ardour3_ui_default.conf.in
index f3a8de0706..f322bb02a1 100644
--- a/gtk2_ardour/ardour3_ui_default.conf.in
+++ b/gtk2_ardour/ardour3_ui_default.conf.in
@@ -81,12 +81,10 @@
<Option name="midi meter fill: 7" value="8fc78eff"/>
<Option name="midi meter fill: 8" value="8fc78eff"/>
<Option name="midi meter fill: 9" value="00f45600"/>
- <Option name="meterbridge peakindicator: fill start" value="444444ff"/>
- <Option name="meterbridge peakindicator: fill end" value="333333ff"/>
- <Option name="meterbridge peakindicator on: fill start" value="ff0000ff"/>
- <Option name="meterbridge peakindicator on: fill end" value="880000ff"/>
- <Option name="meterbridge label: fill start" value="444444ff"/>
- <Option name="meterbridge label: fill end" value="333333ff"/>
+ <Option name="meterbridge peakindicator: fill" value="444444ff"/>
+ <Option name="meterbridge peakindicator: fill active" value="ff0000ff"/>
+ <Option name="meterbridge label: fill" value="444444ff"/>
+ <Option name="meterbridge label: fill active" value="333333ff"/>
<Option name="meterbridge label: text" value="c7c7d8ff"/>
<Option name="meter marker" value="f2425bff"/>
<Option name="midi bus base" value="00000000"/>
@@ -161,8 +159,8 @@
<Option name="selected time axis frame" value="000000ff"/>
<Option name="time stretch fill" value="e2b5b596"/>
<Option name="time stretch outline" value="63636396"/>
- <Option name="tracknumber label: fill start" value="444444ff"/>
- <Option name="tracknumber label: fill end" value="333333ff"/>
+ <Option name="tracknumber label: fill" value="444444ff"/>
+ <Option name="tracknumber label: fill active" value="333333ff"/>
<Option name="tracknumber label: text" value="c7c7d8ff"/>
<Option name="transport drag rect" value="969696c6"/>
<Option name="transport loop rect" value="1e7728f9"/>
@@ -181,333 +179,252 @@
<Option name="zero line" value="7f7f7fe0"/>
<Option name="zoom rect" value="c6d1b26d"/>
<Option name="monitor knob" value="555050ff"/>
+ <Option name="monitor knob: arc start" value="5d90b0ff"/>
+ <Option name="monitor knob: arc end" value="154c6eff"/>
<Option name="button border" value="000000f0"/>
<Option name="border color" value="00000000"/>
- <Option name="processor prefader: fill start" value="873c3cff"/>
+ <Option name="processor prefader: fill" value="873c3cff"/>
<Option name="processor prefader: fill end" value="542525ff"/>
- <Option name="processor prefader: fill start active" value="774c4cff"/>
- <Option name="processor prefader: fill end active" value="603535ff"/>
+ <Option name="processor prefader: fill active" value="603535ff"/>
<Option name="processor prefader: led" value="26550eff"/>
<Option name="processor prefader: led active" value="78cb4eff"/>
<Option name="processor prefader: text" value="aaaaa3ff"/>
<Option name="processor prefader: text active" value="eeeeecff"/>
<Option name="processor fader: fill start" value="5d90b0ff"/>
<Option name="processor fader: fill end" value="154c6eff"/>
- <Option name="processor fader: fill start active" value="5d90b0ff"/>
- <Option name="processor fader: fill end active" value="256d8fff"/>
+ <Option name="processor fader: fill active" value="256d8fff"/>
<Option name="processor fader: led" value="26550eff"/>
<Option name="processor fader: led active" value="78cb4eff"/>
<Option name="processor fader: text" value="aaaaa3ff"/>
<Option name="processor fader: text active" value="eeeeecff"/>
- <Option name="processor postfader: fill start" value="354537ff"/>
+ <Option name="processor postfader: fill" value="354537ff"/>
<Option name="processor postfader: fill end" value="202823ff"/>
- <Option name="processor postfader: fill start active" value="466452ff"/>
- <Option name="processor postfader: fill end active" value="254528ff"/>
+ <Option name="processor postfader: fill active" value="254528ff"/>
<Option name="processor postfader: led" value="26550eff"/>
<Option name="processor postfader: led active" value="78cb4eff"/>
<Option name="processor postfader: text" value="aaaaa3ff"/>
<Option name="processor postfader: text active" value="eeeeecff"/>
- <Option name="processor control button: fill start" value="222222ff"/>
- <Option name="processor control button: fill end" value="333333ff"/>
- <Option name="processor control button: fill start active" value="444444ff"/>
- <Option name="processor control button: fill end active" value="333333ff"/>
+ <Option name="processor control button: fill" value="222222ff"/>
+ <Option name="processor control button: fill active" value="333333ff"/>
<Option name="processor control button: led" value="224400ff"/>
<Option name="processor control button: led active" value="99cc00ff"/>
<Option name="processor control button: text" value="ffffffff"/>
<Option name="processor control button: text active" value="ffffffff"/>
- <Option name="midi device: fill start" value="54555dff"/>
- <Option name="midi device: fill end" value="54555dff"/>
- <Option name="midi device: fill start active" value="3a3a40ff"/>
- <Option name="midi device: fill end active" value="45464cff"/>
+ <Option name="midi device: fill" value="54555dff"/>
+ <Option name="midi device: fill active" value="45464cff"/>
<Option name="midi device: led" value="006600ff"/>
<Option name="midi device: led active" value="00ff00ff"/>
<Option name="midi device: text" value="c7c7d8ff"/>
<Option name="midi device: text active" value="eeeeecff"/>
- <Option name="monitor button: fill start" value="5f5a58ff"/>
- <Option name="monitor button: fill end" value="4f4a48ff"/>
- <Option name="monitor button: fill start active" value="553500ff"/>
- <Option name="monitor button: fill end active" value="e58505ff"/>
+ <Option name="monitor button: fill" value="616268ff"/>
+ <Option name="monitor button: fill active" value="c56505ff"/>
<Option name="monitor button: led" value="660000ff"/>
<Option name="monitor button: led active" value="ff0000ff"/>
- <Option name="monitor button: text" value="aaaaa3ff"/>
+ <Option name="monitor button: text" value="c7c7d8ff"/>
<Option name="monitor button: text active" value="1a1a1aff"/>
- <Option name="meterbridge label: fill start" value="444444ff"/>
- <Option name="meterbridge label: fill end" value="333333ff"/>
- <Option name="meterbridge label: text" value="c7c7d8ff"/>
- <Option name="solo isolate: fill start" value="5f5a58ff"/>
- <Option name="solo isolate: fill end" value="504442ff"/>
- <Option name="solo isolate: fill start active" value="5d5856ff"/>
- <Option name="solo isolate: fill end active" value="564d48ff"/>
+ <Option name="solo isolate: fill" value="616268ff"/>
+ <Option name="solo isolate: fill active" value="564d48ff"/>
<Option name="solo isolate: led" value="660000ff"/>
<Option name="solo isolate: led active" value="ff0000ff"/>
<Option name="solo isolate: text" value="c7c7d8ff"/>
<Option name="solo isolate: text active" value="c8c8d9ff"/>
- <Option name="solo safe: fill start" value="5f5a58ff"/>
- <Option name="solo safe: fill end" value="504442ff"/>
- <Option name="solo safe: fill start active" value="5d5856ff"/>
- <Option name="solo safe: fill end active" value="564d48ff"/>
+ <Option name="solo safe: fill" value="616268ff"/>
+ <Option name="solo safe: fill active" value="564d48ff"/>
<Option name="solo safe: led" value="660000ff"/>
<Option name="solo safe: led active" value="ff0000ff"/>
<Option name="solo safe: text" value="c7c7d8ff"/>
<Option name="solo safe: text active" value="c8c8d9ff"/>
<Option name="meterbridge peaklabel" value="ff1111ff"/>
<Option name="meter color BBC" value="ffa500ff"/>
- <Option name="meterbridge peakindicator: fill start" value="444444ff"/>
- <Option name="meterbridge peakindicator: fill end" value="333333ff"/>
- <Option name="meterbridge peakindicator on: fill start" value="ff0000ff"/>
- <Option name="meterbridge peakindicator on: fill end" value="880000ff"/>
- <Option name="monitor section cut: fill start" value="5f5a58ff"/>
- <Option name="monitor section cut: fill end" value="4f4a48ff"/>
- <Option name="monitor section cut: fill start active" value="5f4943ff"/>
- <Option name="monitor section cut: fill end active" value="ffa500ff"/>
+ <Option name="monitor section cut: fill" value="5f5a58ff"/>
+ <Option name="monitor section cut: fill active" value="ffa500ff"/>
<Option name="monitor section cut: led" value="473812ff"/>
<Option name="monitor section cut: led active" value="78cb4eff"/>
<Option name="monitor section cut: text" value="c7c7d8ff"/>
<Option name="monitor section cut: text active" value="000000ff"/>
- <Option name="monitor section dim: fill start" value="5f5a58ff"/>
- <Option name="monitor section dim: fill end" value="4f4a48ff"/>
- <Option name="monitor section dim: fill start active" value="553500ff"/>
- <Option name="monitor section dim: fill end active" value="e58505ff"/>
+ <Option name="monitor section dim: fill" value="5f5a58ff"/>
+ <Option name="monitor section dim: fill active" value="e58505ff"/>
<Option name="monitor section dim: led" value="00000000"/>
<Option name="monitor section dim: led active" value="78cb4eff"/>
<Option name="monitor section dim: text" value="c8c8d9ff"/>
<Option name="monitor section dim: text active" value="c8c8d9ff"/>
- <Option name="monitor section solo: fill start" value="5f5a58ff"/>
- <Option name="monitor section solo: fill end" value="4f4a48ff"/>
- <Option name="monitor section solo: fill start active" value="104506ff"/>
- <Option name="monitor section solo: fill end active" value="4dbb00ff"/>
+ <Option name="monitor section solo: fill" value="5f5a58ff"/>
+ <Option name="monitor section solo: fill active" value="4dbb00ff"/>
<Option name="monitor section solo: led" value="473812ff"/>
<Option name="monitor section solo: led active" value="ffa500ff"/>
<Option name="monitor section solo: text" value="00000000"/>
<Option name="monitor section solo: text active" value="00000000"/>
- <Option name="monitor section invert: fill start" value="5f5a58ff"/>
- <Option name="monitor section invert: fill end" value="4f4a48ff"/>
- <Option name="monitor section invert: fill start active" value="222260ff"/>
- <Option name="monitor section invert: fill end active" value="4242d0ff"/>
+ <Option name="monitor section invert: fill" value="5f5a58ff"/>
+ <Option name="monitor section invert: fill active" value="4242d0ff"/>
<Option name="monitor section invert: led" value="473812ff"/>
<Option name="monitor section invert: led active" value="78cb4eff"/>
<Option name="monitor section invert: text" value="00000000"/>
<Option name="monitor section invert: text active" value="00000000"/>
- <Option name="monitor section mono: fill start" value="5f5a58ff"/>
- <Option name="monitor section mono: fill end" value="4f4a48ff"/>
- <Option name="monitor section mono: fill start active" value="222260ff"/>
- <Option name="monitor section mono: fill end active" value="3232c0ff"/>
+ <Option name="monitor section mono: fill" value="5f5a58ff"/>
+ <Option name="monitor section mono: fill active" value="3232c0ff"/>
<Option name="monitor section mono: led" value="473812ff"/>
<Option name="monitor section mono: led active" value="78cb4eff"/>
<Option name="monitor section mono: text" value="c7c7d8ff"/>
<Option name="monitor section mono: text active" value="c8c8d9ff"/>
- <Option name="monitor section solo model: fill start" value="5d5856ff"/>
- <Option name="monitor section solo model: fill end" value="564d48ff"/>
- <Option name="monitor section solo model: fill start active" value="5d5856ff"/>
- <Option name="monitor section solo model: fill end active" value="564d48ff"/>
+ <Option name="monitor section solo model: fill" value="5d5856ff"/>
+ <Option name="monitor section solo model: fill active" value="564d48ff"/>
<Option name="monitor section solo model: led" value="4f3300ff"/>
<Option name="monitor section solo model: led active" value="ffa500ff"/>
<Option name="monitor section solo model: text" value="c7c7d8ff"/>
<Option name="monitor section solo model: text active" value="c8c8d9ff"/>
- <Option name="monitor solo override: fill start" value="5d5856ff"/>
- <Option name="monitor solo override: fill end" value="564d48ff"/>
- <Option name="monitor solo override: fill start active" value="5d5856ff"/>
- <Option name="monitor solo override: fill end active" value="564d48ff"/>
+ <Option name="monitor solo override: fill" value="5d5856ff"/>
+ <Option name="monitor solo override: fill active" value="564d48ff"/>
<Option name="monitor solo override: led" value="4f3300ff"/>
<Option name="monitor solo override: led active" value="ffa500ff"/>
<Option name="monitor solo override: text" value="c7c7d8ff"/>
<Option name="monitor solo override: text active" value="c8c8d9ff"/>
- <Option name="monitor solo exclusive: fill start" value="5d5856ff"/>
- <Option name="monitor solo exclusive: fill end" value="564d48ff"/>
- <Option name="monitor solo exclusive: fill start active" value="5d5856ff"/>
- <Option name="monitor solo exclusive: fill end active" value="564c47ff"/>
+ <Option name="monitor solo exclusive: fill" value="5d5856ff"/>
+ <Option name="monitor solo exclusive: fill active" value="564c47ff"/>
<Option name="monitor solo exclusive: led" value="4f3300ff"/>
<Option name="monitor solo exclusive: led active" value="ffa500ff"/>
<Option name="monitor solo exclusive: text" value="c7c7d8ff"/>
<Option name="monitor solo exclusive: text active" value="c8c8d9ff"/>
- <Option name="rude solo: fill start" value="684d4dff"/>
- <Option name="rude solo: fill end" value="513c3cff"/>
- <Option name="rude solo: fill start active" value="ff1f1fff"/>
- <Option name="rude solo: fill end active" value="e21b1bff"/>
+ <Option name="rude solo: fill" value="684d4dff"/>
+ <Option name="rude solo: fill active" value="e21b1bff"/>
<Option name="rude solo: led" value="00000000"/>
<Option name="rude solo: led active" value="00000000"/>
<Option name="rude solo: text" value="969696ff"/>
<Option name="rude solo: text active" value="e5e5e5ff"/>
- <Option name="rude isolate: fill start" value="21414fff"/>
- <Option name="rude isolate: fill end" value="192930ff"/>
- <Option name="rude isolate: fill start active" value="e5f7ffff"/>
- <Option name="rude isolate: fill end active" value="b6e5fdff"/>
+ <Option name="rude isolate: fill" value="21414fff"/>
+ <Option name="rude isolate: fill active" value="b6e5fdff"/>
<Option name="rude isolate: led" value="00000000"/>
<Option name="rude isolate: led active" value="000000ff"/>
<Option name="rude isolate: text" value="979797ff"/>
<Option name="rude isolate: text active" value="000000ff"/>
- <Option name="rude audition: fill start" value="684d4dff"/>
- <Option name="rude audition: fill end" value="513c3cff"/>
- <Option name="rude audition: fill start active" value="ff1f1fff"/>
- <Option name="rude audition: fill end active" value="e21b1bff"/>
+ <Option name="rude audition: fill" value="684d4dff"/>
+ <Option name="rude audition: fill active" value="e21b1bff"/>
<Option name="rude audition: led" value="00000000"/>
<Option name="rude audition: led active" value="00000000"/>
<Option name="rude audition: text" value="979797ff"/>
<Option name="rude audition: text active" value="ffffffff"/>
- <Option name="feedback alert: fill start" value="684d4dff"/>
- <Option name="feedback alert: fill end" value="513c3cff"/>
- <Option name="feedback alert: fill start active" value="ff1f1fff"/>
- <Option name="feedback alert: fill end active" value="e21b1bff"/>
+ <Option name="feedback alert: fill" value="684d4dff"/>
+ <Option name="feedback alert: fill active" value="e21b1bff"/>
<Option name="feedback alert: led" value="00000000"/>
<Option name="feedback alert: led active" value="00000000"/>
<Option name="feedback alert: text" value="969696ff"/>
<Option name="feedback alert: text active" value="e5e5e5ff"/>
- <Option name="mute button: fill start" value="565659ff"/>
- <Option name="mute button: fill end" value="404149ff"/>
- <Option name="mute button: fill start active" value="5f4943ff"/>
- <Option name="mute button: fill end active" value="ffff00ff"/>
+ <Option name="mute button: fill" value="616268ff"/>
+ <Option name="mute button: fill active" value="bbbb00ff"/>
<Option name="mute button: led" value="00000000"/>
<Option name="mute button: led active" value="00000000"/>
- <Option name="mute button: text" value="bfbfafff"/>
+ <Option name="mute button: text" value="c7c7d8ff"/>
<Option name="mute button: text active" value="191919ff"/>
- <Option name="solo button: fill start" value="565659ff"/>
- <Option name="solo button: fill end" value="404149ff"/>
- <Option name="solo button: fill start active" value="1d7a05ff"/>
- <Option name="solo button: fill end active" value="4dbb00ff"/>
+ <Option name="solo button: fill" value="616268ff"/>
+ <Option name="solo button: fill active" value="4dbb00ff"/>
<Option name="solo button: led" value="00000000"/>
<Option name="solo button: led active" value="00000000"/>
- <Option name="solo button: text" value="afbfafff"/>
+ <Option name="solo button: text" value="c7c7d8ff"/>
<Option name="solo button: text active" value="191919ff"/>
- <Option name="invert button: fill start" value="565659ff"/>
+ <Option name="invert button: fill" value="616268ff"/>
<Option name="invert button: fill end" value="404149ff"/>
- <Option name="invert button: fill start active" value="222260ff"/>
- <Option name="invert button: fill end active" value="4242d0ff"/>
+ <Option name="invert button: fill active" value="4242d0ff"/>
<Option name="invert button: led" value="473812ff"/>
<Option name="invert button: led active" value="78cb4eff"/>
- <Option name="invert button: text" value="bfbfbfff"/>
+ <Option name="invert button: text" value="d7d7e8ff"/>
<Option name="invert button: text active" value="bfbfbfff"/>
- <Option name="record enable button: fill start" value="3e312fff"/>
- <Option name="record enable button: fill end" value="3f312fff"/>
- <Option name="record enable button: fill start active" value="c10b0bff"/>
- <Option name="record enable button: fill end active" value="fd0000ff"/>
+ <Option name="record enable button: fill" value="616268ff"/>
+ <Option name="record enable button: fill active" value="b50e0eff"/>
<Option name="record enable button: led" value="7b3541ff"/>
<Option name="record enable button: led active" value="ffa3b3ff"/>
<Option name="record enable button: text" value="a5a5a5ff"/>
<Option name="record enable button: text active" value="000000ff"/>
- <Option name="generic button: fill start" value="3e312fff"/>
- <Option name="generic button: fill end" value="3f312fff"/>
- <Option name="generic button: fill start active" value="c10b0bff"/>
- <Option name="generic button: fill end active" value="fd0000ff"/>
+ <Option name="generic button: fill" value="3e312fff"/>
+ <Option name="generic button: fill active" value="fd0000ff"/>
<Option name="generic button: led" value="7b3541ff"/>
<Option name="generic button: led active" value="ffa3b3ff"/>
<Option name="generic button: text" value="ff0000ff"/>
<Option name="generic button: text active" value="000000ff"/>
- <Option name="send alert button: fill start" value="4e5647ff"/>
- <Option name="send alert button: fill end" value="43493cff"/>
- <Option name="send alert button: fill start active" value="91f928ff"/>
- <Option name="send alert button: fill end active" value="85e524ff"/>
+ <Option name="send alert button: fill" value="4e5647ff"/>
+ <Option name="send alert button: fill active" value="85e524ff"/>
<Option name="send alert button: led" value="00000000"/>
<Option name="send alert button: led active" value="00000000"/>
<Option name="send alert button: text" value="ccccccff"/>
<Option name="send alert button: text active" value="000000ff"/>
- <Option name="transport button: fill start" value="616268ff"/>
- <Option name="transport button: fill end" value="4a4b51ff"/>
- <Option name="transport button: fill start active" value="1d7a05ff"/>
- <Option name="transport button: fill end active" value="00a300ff"/>
+ <Option name="transport button: fill" value="616268ff"/>
+ <Option name="transport button: fill active" value="00a300ff"/>
<Option name="transport button: led" value="00000000"/>
<Option name="transport button: led active" value="00000000"/>
<Option name="transport button: text" value="00000000"/>
<Option name="transport button: text active" value="00000000"/>
- <Option name="transport recenable button: fill start" value="5f3f3fff"/>
- <Option name="transport recenable button: fill end" value="3d2828ff"/>
- <Option name="transport recenable button: fill start active" value="6a0404ff"/>
- <Option name="transport recenable button: fill end active" value="b50e0eff"/>
+ <Option name="transport recenable button: fill" value="5f3f3fff"/>
+ <Option name="transport recenable button: fill active" value="b50e0eff"/>
<Option name="transport recenable button: led" value="00000000"/>
<Option name="transport recenable button: led active" value="00000000"/>
<Option name="transport recenable button: text" value="00000000"/>
<Option name="transport recenable button: text active" value="00000000"/>
- <Option name="transport option button: fill start" value="636470ff"/>
- <Option name="transport option button: fill end" value="4a4b51ff"/>
- <Option name="transport option button: fill start active" value="636470ff"/>
- <Option name="transport option button: fill end active" value="4a4b51ff"/>
+ <Option name="transport option button: fill" value="616268ff"/>
+ <Option name="transport option button: fill active" value="4a4b51ff"/>
<Option name="transport option button: led" value="4f3300ff"/>
<Option name="transport option button: led active" value="ffa500ff"/>
- <Option name="transport option button: text" value="c7c7d8ff"/>
+ <Option name="transport option button: text" value="d7d7e8ff"/>
<Option name="transport option button: text active" value="c8c8d9ff"/>
- <Option name="transport active option button: fill start" value="636470ff"/>
- <Option name="transport active option button: fill end" value="4a4b51ff"/>
- <Option name="transport active option button: fill start active" value="1d7a05ff"/>
- <Option name="transport active option button: fill end active" value="00a300ff"/>
+ <Option name="transport active option button: fill" value="616268ff"/>
+ <Option name="transport active option button: fill active" value="00a300ff"/>
<Option name="transport active option button: led" value="4f3300ff"/>
<Option name="transport active option button: led active" value="ffa500ff"/>
- <Option name="transport active option button: text" value="c7c7d8ff"/>
+ <Option name="transport active option button: text" value="d7d7e8ff"/>
<Option name="transport active option button: text active" value="000000ff"/>
- <Option name="plugin bypass button: fill start" value="5d5856ff"/>
- <Option name="plugin bypass button: fill end" value="564d48ff"/>
- <Option name="plugin bypass button: fill start active" value="5d5856ff"/>
- <Option name="plugin bypass button: fill end active" value="564d48ff"/>
+ <Option name="plugin bypass button: fill" value="5d5856ff"/>
+ <Option name="plugin bypass button: fill active" value="564d48ff"/>
<Option name="plugin bypass button: led" value="660000ff"/>
<Option name="plugin bypass button: led active" value="ff0000ff"/>
<Option name="plugin bypass button: text" value="c7c7d8ff"/>
<Option name="plugin bypass button: text active" value="c8c8d9ff"/>
- <Option name="punch button: fill start" value="603f3fff"/>
- <Option name="punch button: fill end" value="3d2828ff"/>
- <Option name="punch button: fill start active" value="503010ff"/>
- <Option name="punch button: fill end active" value="f03020ff"/>
+ <Option name="punch button: fill" value="603f3fff"/>
+ <Option name="punch button: fill active" value="f03020ff"/>
<Option name="punch button: led" value="00000000"/>
<Option name="punch button: led active" value="00000000"/>
<Option name="punch button: text" value="a5a5a5ff"/>
<Option name="punch button: text active" value="d8d8d8ff"/>
- <Option name="mouse mode button: fill start" value="616268ff"/>
- <Option name="mouse mode button: fill end" value="45464dff"/>
- <Option name="mouse mode button: fill start active" value="1e7f05ff"/>
- <Option name="mouse mode button: fill end active" value="00b200ff"/>
+ <Option name="mouse mode button: fill" value="616268ff"/>
+ <Option name="mouse mode button: fill active" value="00b200ff"/>
<Option name="mouse mode button: led" value="4f3300ff"/>
<Option name="mouse mode button: led active" value="ffa500ff"/>
- <Option name="mouse mode button: text" value="c7c7d8ff"/>
+ <Option name="mouse mode button: text" value="d7d7e8ff"/>
<Option name="mouse mode button: text active" value="000000ff"/>
- <Option name="nudge button: fill start" value="785754dd"/>
- <Option name="nudge button: fill end" value="564242dd"/>
- <Option name="nudge button: fill start active" value="202025ff"/>
- <Option name="nudge button: fill end active" value="404045ff"/>
+ <Option name="nudge button: fill" value="684744ff"/>
+ <Option name="nudge button: fill active" value="404045ff"/>
<Option name="nudge button: led" value="4f3300ff"/>
<Option name="nudge button: led active" value="ffa500ff"/>
<Option name="nudge button: text" value="c7c7d8ff"/>
<Option name="nudge button: text active" value="c8c8d9ff"/>
- <Option name="zoom menu: fill start" value="99997950"/>
- <Option name="zoom menu: fill end" value="99996999"/>
- <Option name="zoom menu: fill start active" value="202025ff"/>
- <Option name="zoom menu: fill end active" value="404045ff"/>
+ <Option name="zoom menu: fill" value="99997950"/>
+ <Option name="zoom menu: fill active" value="404045ff"/>
<Option name="zoom menu: led" value="4f3300ff"/>
<Option name="zoom menu: led active" value="ffa500ff"/>
- <Option name="zoom menu: text" value="c7c7d8ff"/>
+ <Option name="zoom menu: text" value="d7d7e8ff"/>
<Option name="zoom menu: text active" value="c8c8d9ff"/>
- <Option name="zoom button: fill start" value="616268ff"/>
- <Option name="zoom button: fill end" value="45464dff"/>
- <Option name="zoom button: fill start active" value="1d7a05ff"/>
- <Option name="zoom button: fill end active" value="00a300ff"/>
+ <Option name="zoom button: fill" value="616268ff"/>
+ <Option name="zoom button: fill active" value="00a300ff"/>
<Option name="zoom button: led" value="4f3300ff"/>
<Option name="zoom button: led active" value="ffa500ff"/>
- <Option name="zoom button: text" value="c7c7d8ff"/>
+ <Option name="zoom button: text" value="d7d7e8ff"/>
<Option name="zoom button: text active" value="000000ff"/>
- <Option name="route button: fill start" value="565659ff"/>
- <Option name="route button: fill end" value="404149ff"/>
- <Option name="route button: fill start active" value="4d4d4dff"/>
- <Option name="route button: fill end active" value="121212ff"/>
+ <Option name="route button: fill" value="616268ff"/>
+ <Option name="route button: fill active" value="121212ff"/>
<Option name="route button: led" value="4f3300ff"/>
<Option name="route button: led active" value="ffa500ff"/>
- <Option name="route button: text" value="bfbfbfff"/>
+ <Option name="route button: text" value="d7d7e8ff"/>
<Option name="route button: text active" value="191919ff"/>
- <Option name="mixer strip button: fill start" value="565659ff"/>
- <Option name="mixer strip button: fill end" value="454652ff"/>
- <Option name="mixer strip button: fill start active" value="5f4943ff"/>
- <Option name="mixer strip button: fill end active" value="ffa500ff"/>
+ <Option name="mixer strip button: fill" value="616268ff"/>
+ <Option name="mixer strip button: fill active" value="ffa500ff"/>
<Option name="mixer strip button: led" value="4f3300ff"/>
<Option name="mixer strip button: led active" value="ffa500ff"/>
- <Option name="mixer strip button: text" value="c7c7d8ff"/>
+ <Option name="mixer strip button: text" value="d7d7e8ff"/>
<Option name="mixer strip button: text active" value="000000ff"/>
- <Option name="mixer strip name button: fill start" value="565659ff"/>
- <Option name="mixer strip name button: fill end" value="404149ff"/>
- <Option name="mixer strip name button: fill start active" value="4d4d4dff"/>
- <Option name="mixer strip name button: fill end active" value="121212ff"/>
+ <Option name="mixer strip name button: fill" value="616268ff"/>
+ <Option name="mixer strip name button: fill active" value="121212ff"/>
<Option name="mixer strip name button: led" value="4f3300ff"/>
<Option name="mixer strip name button: led active" value="ffa500ff"/>
- <Option name="mixer strip name button: text" value="c7c7d8ff"/>
+ <Option name="mixer strip name button: text" value="d7d7e8ff"/>
<Option name="mixer strip name button: text active" value="c8c8d9ff"/>
- <Option name="midi input button: fill start" value="656867ff"/>
- <Option name="midi input button: fill end" value="333333ff"/>
- <Option name="midi input button: fill start active" value="a1ff43ff"/>
- <Option name="midi input button: fill end active" value="00a300ff"/>
+ <Option name="midi input button: fill" value="656867ff"/>
+ <Option name="midi input button: fill active" value="00a300ff"/>
<Option name="midi input button: led" value="00000000"/>
<Option name="midi input button: led active" value="00000000"/>
<Option name="midi input button: text" value="00000000"/>
@@ -552,10 +469,8 @@
<Option name="clock: text" value="6bb620ff"/>
<Option name="clock: edited text" value="ffa500ff"/>
<Option name="clock: cursor" value="ffa500ff"/>
- <Option name="lock button: fill start" value="ff2714dd"/>
- <Option name="lock button: fill end" value="8b0000ff"/>
- <Option name="lock button: fill start active" value="202025ff"/>
- <Option name="lock button: fill end active" value="404045ff"/>
+ <Option name="lock button: fill" value="616268ff"/>
+ <Option name="lock button: fill active" value="404045ff"/>
<Option name="lock button: led" value="00000000"/>
<Option name="lock button: led active" value="00000000"/>
<Option name="lock button: text" value="000024ff"/>
diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc
index 1337bb9eeb..4cfa5f2562 100644
--- a/gtk2_ardour/ardour_button.cc
+++ b/gtk2_ardour/ardour_button.cc
@@ -33,6 +33,8 @@
#include "ardour/rc_configuration.h" // for widget prelight preference
+#include "canvas/utils.h"
+
#include "ardour_button.h"
#include "ardour_ui.h"
#include "global_signals.h"
@@ -65,21 +67,15 @@ ArdourButton::ArdourButton (Element e)
, _angle(0)
, _xalign(.5)
, _yalign(.5)
- , bg_color (0)
- , border_color (0)
- , fill_start_inactive_color (0)
- , fill_end_inactive_color (0)
- , fill_start_active_color (0)
- , fill_end_active_color (0)
+ , fill_inactive_color (0)
+ , fill_active_color (0)
, text_active_color(0)
, text_inactive_color(0)
, led_active_color(0)
, led_inactive_color(0)
- , fill_pattern (0)
- , fill_pattern_active (0)
- , shine_pattern (0)
+ , convex_pattern (0)
+ , concave_pattern (0)
, led_inset_pattern (0)
- , reflection_pattern (0)
, _led_rect (0)
, _act_on_release (true)
, _led_left (false)
@@ -103,21 +99,15 @@ ArdourButton::ArdourButton (const std::string& str, Element e)
, _angle(0)
, _xalign(.5)
, _yalign(.5)
- , bg_color (0)
- , border_color (0)
- , fill_start_inactive_color (0)
- , fill_end_inactive_color (0)
- , fill_start_active_color (0)
- , fill_end_active_color (0)
+ , fill_inactive_color (0)
+ , fill_active_color (0)
, text_active_color(0)
, text_inactive_color(0)
, led_active_color(0)
, led_inactive_color(0)
- , fill_pattern (0)
- , fill_pattern_active (0)
- , shine_pattern (0)
+ , convex_pattern (0)
+ , concave_pattern (0)
, led_inset_pattern (0)
- , reflection_pattern (0)
, _led_rect (0)
, _act_on_release (true)
, _led_left (false)
@@ -134,25 +124,17 @@ ArdourButton::~ArdourButton()
{
delete _led_rect;
- if (shine_pattern) {
- cairo_pattern_destroy (shine_pattern);
- }
-
- if (fill_pattern) {
- cairo_pattern_destroy (fill_pattern);
+ if (convex_pattern) {
+ cairo_pattern_destroy (convex_pattern);
}
- if (fill_pattern_active) {
- cairo_pattern_destroy (fill_pattern_active);
+ if (concave_pattern) {
+ cairo_pattern_destroy (concave_pattern);
}
if (led_inset_pattern) {
cairo_pattern_destroy (led_inset_pattern);
}
-
- if (reflection_pattern) {
- cairo_pattern_destroy (reflection_pattern);
- }
}
@@ -201,6 +183,16 @@ ArdourButton::set_alignment (const float xa, const float ya)
void
ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
{
+ uint32_t text_color;
+ uint32_t led_color;
+ if ( active_state() == Gtkmm2ext::ExplicitActive ) {
+ text_color = text_active_color;
+ led_color = led_active_color;
+ } else {
+ text_color = text_inactive_color;
+ led_color = led_inactive_color;
+ }
+
void (*rounded_function)(cairo_t*, double, double, double, double, double);
switch (_corner_mask) {
@@ -223,9 +215,8 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
if (!_fixed_diameter) {
_diameter = std::min (get_width(), get_height());
}
-
- float r,g,b,a;
-
+
+ //border and background fill
if ((_elements & Body)==Body) {
if (_elements & Edge) {
@@ -238,67 +229,49 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
rounded_function (cr, 0, 0, get_width(), get_height(), _corner_radius);
}
- if (active_state() == Gtkmm2ext::ImplicitActive) {
+ if (active_state() == Gtkmm2ext::ImplicitActive && !((_elements & Indicator)==Indicator)) {
- if (!(_tweaks & ImplicitUsesSolidColor)) {
- cairo_set_source (cr, fill_pattern);
- } else {
- cairo_set_source (cr, fill_pattern_active);
- }
+ ArdourCanvas::set_source_rgba (cr, fill_inactive_color);
cairo_fill (cr);
-
- if (!(_tweaks & ImplicitUsesSolidColor)) {
- //border
- UINT_TO_RGBA (fill_end_active_color, &r, &g, &b, &a);
- cairo_set_line_width (cr, 1.0);
- rounded_function (cr, 2, 2, get_width()-4, get_height()-4, _corner_radius - 1.5);
- cairo_set_source_rgba (cr, r/255.0, g/255.0, b/255.0, a/255.0);
- cairo_stroke (cr);
- }
+
+ //border
+ cairo_set_line_width (cr, 2.0);
+ rounded_function (cr, 2, 2, get_width()-4, get_height()-4, _corner_radius - 1.5);
+ ArdourCanvas::set_source_rgba (cr, fill_active_color);
+ cairo_stroke (cr);
- } else if (active_state() == Gtkmm2ext::ExplicitActive || ((_elements & Indicator)==Indicator) ) {
+ } else if ( (active_state() == Gtkmm2ext::ExplicitActive) && !((_elements & Indicator)==Indicator) ) {
//background color
- cairo_set_source (cr, fill_pattern_active);
+ ArdourCanvas::set_source_rgba (cr, fill_active_color);
cairo_fill (cr);
- } else {
+ } else { //inactive, or it has an indicator
//background color
- cairo_set_source (cr, fill_pattern);
+ ArdourCanvas::set_source_rgba (cr, fill_inactive_color);
cairo_fill (cr);
}
}
- if ( ((_elements & Inset)==Inset) && (active_state() != Gtkmm2ext::ExplicitActive) ) {
-
- if ( !_flat_buttons ) {
- float rheight = get_height()*0.5-REFLECTION_HEIGHT;
- Gtkmm2ext::rounded_rectangle (cr, 2, 3, get_width()-4, rheight, _corner_radius-1);
- cairo_set_source (cr, shine_pattern);
+ //show the "convex" or "concave" gradient
+ if (!_flat_buttons) {
+ if ( active_state() == Gtkmm2ext::ExplicitActive && !((_elements & Indicator)==Indicator) ) {
+ //concave
+ float width = get_width(); float height = get_height();
+ cairo_set_source (cr, concave_pattern);
+ Gtkmm2ext::rounded_rectangle (cr, 1, 1, width-2, height-2, _corner_radius - 1.5);
cairo_fill (cr);
- }
-
- if (active_state() == Gtkmm2ext::ExplicitActive) {
-
- UINT_TO_RGBA (fill_start_active_color, &r, &g, &b, &a);
- cairo_set_line_width (cr, 2.0);
- rounded_function (cr, 2, 2, get_width()-4, get_height()-4, _corner_radius - 2.0);
- cairo_set_source_rgba (cr, r/255.0, g/255.0, b/255.0, a/255.0);
- cairo_fill (cr);
-
} else {
-
- UINT_TO_RGBA (fill_start_inactive_color, &r, &g, &b, &a);
- cairo_set_line_width (cr, 2.0);
- rounded_function (cr, 2, 2, get_width()-4, get_height()-4, _corner_radius - 2.0);
- cairo_set_source_rgba (cr, r/255.0, g/255.0, b/255.0, a/255.0);
+ float width = get_width(); float height = get_height();
+ cairo_set_source (cr, convex_pattern);
+ Gtkmm2ext::rounded_rectangle (cr, 1, 1, width-2, height-2, _corner_radius - 1.5);
cairo_fill (cr);
-
}
}
+ //Pixbuf, if any
if (_pixbuf) {
double x,y;
@@ -312,9 +285,15 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
cairo_translate (cr, -8,0 );
}
- cairo_rectangle (cr, x, y, _pixbuf->get_width(), _pixbuf->get_height());
- gdk_cairo_set_source_pixbuf (cr, _pixbuf->gobj(), x, y);
- cairo_fill (cr);
+ if (_grabbed) {
+ cairo_rectangle (cr, x+1, y+1, _pixbuf->get_width(), _pixbuf->get_height());
+ gdk_cairo_set_source_pixbuf (cr, _pixbuf->gobj(), x+1, y+1);
+ cairo_fill (cr);
+ } else {
+ cairo_rectangle (cr, x, y, _pixbuf->get_width(), _pixbuf->get_height());
+ gdk_cairo_set_source_pixbuf (cr, _pixbuf->gobj(), x, y);
+ cairo_fill (cr);
+ }
//..and then return to our previous drawing position
if (((_elements & Menu)==Menu)) {
@@ -322,23 +301,22 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
}
}
- /* text, if any */
-
int text_margin;
-
if (get_width() < 75) {
text_margin = 5;
} else {
text_margin = 10;
}
+ // Text, if any
if ( !_pixbuf && ((_elements & Text)==Text) && !_text.empty()) {
+
cairo_save (cr);
cairo_rectangle (cr, 2, 1, get_width()-4, get_height()-2);
cairo_clip(cr);
cairo_new_path (cr);
- cairo_set_source_rgba (cr, text_r, text_g, text_b, text_a);
+ ArdourCanvas::set_source_rgba (cr, text_color);
if ( (_elements & Menu) == Menu) {
cairo_move_to (cr, text_margin, get_height()/2.0 - _text_height/2.0);
@@ -382,6 +360,7 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
cairo_restore (cr);
}
+ //Menu "triangle"
if (((_elements & Menu)==Menu)) {
cairo_save (cr);
@@ -401,6 +380,7 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
cairo_restore (cr);
}
+ //Indicator LED
if (((_elements & Indicator)==Indicator)) {
/* move to the center of the indicator/led */
@@ -428,7 +408,7 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
cairo_fill(cr);
//led color
- cairo_set_source_rgba (cr, led_r, led_g, led_b, led_a);
+ ArdourCanvas::set_source_rgba (cr, led_color);
cairo_arc (cr, 0, 0, _diameter/2-3, 0, 2 * M_PI);
cairo_fill(cr);
@@ -436,27 +416,14 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
}
- /* a partially transparent gray layer to indicate insensitivity */
-
+ // a transparent gray layer to indicate insensitivity
if ((visual_state() & Gtkmm2ext::Insensitive)) {
- rounded_function (cr, 0, 0, get_width(), get_height(), _corner_radius);
+ rounded_function (cr, 1, 1, get_width()-2, get_height()-2, _corner_radius);
cairo_set_source_rgba (cr, 0.505, 0.517, 0.525, 0.6);
cairo_fill (cr);
}
- //reflection
- bool show_reflection = (active_state() == Gtkmm2ext::ExplicitActive);
- show_reflection &= !_flat_buttons;
- show_reflection &= !((_elements & Indicator)==Indicator);
- if ( show_reflection ) {
- float rheight = get_height()*0.5-REFLECTION_HEIGHT;
- Gtkmm2ext::rounded_rectangle (cr, 2, get_height()*0.5-1, get_width()-4, rheight, _corner_radius-1);
- cairo_set_source (cr, shine_pattern);
- cairo_fill (cr);
- }
-
- /* if requested, show hovering */
-
+ // if requested, show hovering
if (ARDOUR::Config->get_widget_prelight()
&& !((visual_state() & Gtkmm2ext::Insensitive))) {
if (_hovering) {
@@ -465,12 +432,24 @@ ArdourButton::render (cairo_t* cr, cairo_rectangle_t *)
cairo_fill (cr);
}
}
+
+ //user is currently pressing the button. black outline helps to indicate this
+ if ( _grabbed && !((_elements & Menu)==Menu) ) {
+ cairo_set_line_width(cr,1);
+ rounded_function (cr, 1, 1, get_width()-2, get_height()-2, _corner_radius - 1);
+ cairo_set_source_rgba (cr, 0, 0, 0, 1.0);
+ cairo_stroke (cr);
+ }
+
+ //some buttons (like processor boxes) can be selected (so they can be deleted). Draw a white box around them
if (visual_state() & Gtkmm2ext::Selected) {
- cairo_set_line_width(cr,2);
- rounded_function (cr, 0, 0, get_width(), get_height(), _corner_radius);
- cairo_set_source_rgba (cr, 1, 0, 0, 0.5);
- cairo_stroke (cr);
+ cairo_set_line_width(cr,2);
+ rounded_function (cr, 0, 0, get_width(), get_height(), _corner_radius);
+ cairo_set_source_rgba (cr, 1, 1, 1, 0.75);
+ cairo_stroke (cr);
}
+
+ //I guess this means we have keyboard focus. I don't think this works currently
if (_focused) {
rounded_function (cr, 1.5, 1.5, get_width() - 3, get_height() - 3, _corner_radius);
cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.8);
@@ -569,13 +548,8 @@ ArdourButton::set_colors ()
}
std::string name = get_name();
- border_color = ARDOUR_UI::config()->color_by_name ("button border");
-
- fill_start_active_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start active", name));
- fill_end_active_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", name));
-
- fill_start_inactive_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start", name));
- fill_end_inactive_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end", name));
+ fill_active_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill active", name));
+ fill_inactive_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill", name));
text_active_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: text active", name));
text_inactive_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: text", name));
@@ -592,7 +566,8 @@ void ArdourButton::set_fixed_colors (const uint32_t color_active, const uint32_t
{
_fixed_colors_set = true;
- fill_start_active_color = fill_end_active_color = color_active;
+ fill_active_color = color_active;
+ fill_inactive_color = color_inactive;
unsigned char r, g, b, a;
UINT_TO_RGBA(color_active, &r, &g, &b, &a);
@@ -605,13 +580,25 @@ void ArdourButton::set_fixed_colors (const uint32_t color_active, const uint32_t
(max (double(g), 0.) - min (double(g), 0.)) +
(max (double(b), 0.) - min (double(b), 0.));
- text_active_color =
- text_inactive_color = (white_contrast > black_contrast) ?
+ text_active_color = (white_contrast > black_contrast) ?
RGBA_TO_UINT(255, 255, 255, 255) : /* use white */
RGBA_TO_UINT( 0, 0, 0, 255); /* use black */
- fill_start_inactive_color = fill_end_inactive_color = color_inactive;
+ UINT_TO_RGBA(color_inactive, &r, &g, &b, &a);
+
+ white_contrast = (max (double(r), 255.) - min (double(r), 255.)) +
+ (max (double(g), 255.) - min (double(g), 255.)) +
+ (max (double(b), 255.) - min (double(b), 255.));
+
+ black_contrast = (max (double(r), 0.) - min (double(r), 0.)) +
+ (max (double(g), 0.) - min (double(g), 0.)) +
+ (max (double(b), 0.) - min (double(b), 0.));
+
+ text_inactive_color = (white_contrast > black_contrast) ?
+ RGBA_TO_UINT(255, 255, 255, 255) : /* use white */
+ RGBA_TO_UINT( 0, 0, 0, 255); /* use black */
+
/* XXX what about led colors ? */
build_patterns ();
@@ -621,117 +608,37 @@ void ArdourButton::set_fixed_colors (const uint32_t color_active, const uint32_t
void
ArdourButton::build_patterns ()
{
- uint32_t start_color;
- uint32_t end_color;
- uint32_t text_color;
- uint32_t led_color;
- uint32_t r, g, b, a;
-
- if (shine_pattern) {
- cairo_pattern_destroy (shine_pattern);
- shine_pattern = 0;
- }
-
- if (fill_pattern) {
- cairo_pattern_destroy (fill_pattern);
- fill_pattern = 0;
+ if (convex_pattern) {
+ cairo_pattern_destroy (convex_pattern);
+ convex_pattern = 0;
}
- if (fill_pattern_active) {
- cairo_pattern_destroy (fill_pattern_active);
- fill_pattern_active = 0;
- }
-
- if (_elements & Body) {
-
- if (_flat_buttons) {
- end_color = start_color = fill_start_active_color;
- } else {
- start_color = fill_start_active_color;
- end_color = fill_end_active_color;
- }
- UINT_TO_RGBA (start_color, &r, &g, &b, &a);
-
- active_r = r/255.0;
- active_g = g/255.0;
- active_b = b/255.0;
- active_a = a/255.0;
-
- shine_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height());
- cairo_pattern_add_color_stop_rgba (shine_pattern, 0, 1,1,1,0.0);
- cairo_pattern_add_color_stop_rgba (shine_pattern, 0.5, 1,1,1,0.1);
- cairo_pattern_add_color_stop_rgba (shine_pattern, 0.7, 1,1,1,0.2);
- cairo_pattern_add_color_stop_rgba (shine_pattern, 1, 1,1,1,0.1);
-
- fill_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height()-3);
- if (_flat_buttons) {
- end_color = start_color = fill_start_inactive_color;
- } else {
- start_color = fill_start_inactive_color;
- end_color = fill_end_inactive_color;
- }
- UINT_TO_RGBA (start_color, &r, &g, &b, &a);
- cairo_pattern_add_color_stop_rgba (fill_pattern, 0, r/255.0,g/255.0,b/255.0, a/255.0);
- UINT_TO_RGBA (end_color, &r, &g, &b, &a);
- cairo_pattern_add_color_stop_rgba (fill_pattern, 1, r/255.0,g/255.0,b/255.0, a/255.0);
-
- fill_pattern_active = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height()-3);
- if (_flat_buttons) {
- if (active_state() == Gtkmm2ext::ImplicitActive && (_tweaks & ImplicitUsesSolidColor)) {
- end_color = start_color = led_active_color;
- } else {
- end_color = start_color = fill_end_active_color;
- }
- } else {
- if (active_state() == Gtkmm2ext::ImplicitActive && (_tweaks & ImplicitUsesSolidColor)) {
- end_color = start_color = led_active_color;
- } else {
- start_color = fill_start_active_color;
- end_color = fill_end_active_color;
- }
- }
- UINT_TO_RGBA (start_color, &r, &g, &b, &a);
- cairo_pattern_add_color_stop_rgba (fill_pattern_active, 0, r/255.0,g/255.0,b/255.0, a/255.0);
- UINT_TO_RGBA (end_color, &r, &g, &b, &a);
- cairo_pattern_add_color_stop_rgba (fill_pattern_active, 1, r/255.0,g/255.0,b/255.0, a/255.0);
+ if (concave_pattern) {
+ cairo_pattern_destroy (concave_pattern);
+ concave_pattern = 0;
}
if (led_inset_pattern) {
cairo_pattern_destroy (led_inset_pattern);
}
- if (reflection_pattern) {
- cairo_pattern_destroy (reflection_pattern);
- }
+ float width = get_width(); float height = get_height();
+
+ //convex gradient
+ convex_pattern = cairo_pattern_create_linear (0.0, 0, 0.0, height);
+ cairo_pattern_add_color_stop_rgba (convex_pattern, 0.0, 0,0,0, 0.0);
+ cairo_pattern_add_color_stop_rgba (convex_pattern, 1.0, 0,0,0, 0.35);
+
+ //concave gradient
+ concave_pattern = cairo_pattern_create_linear (0.0, 0, 0.0, height);
+ cairo_pattern_add_color_stop_rgba (concave_pattern, 0.0, 0,0,0, 0.5);
+ cairo_pattern_add_color_stop_rgba (concave_pattern, 0.7, 0,0,0, 0.0);
if (_elements & Indicator) {
led_inset_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, _diameter);
cairo_pattern_add_color_stop_rgba (led_inset_pattern, 0, 0,0,0, 0.4);
cairo_pattern_add_color_stop_rgba (led_inset_pattern, 1, 1,1,1, 0.7);
-
- reflection_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, _diameter/2-3);
- cairo_pattern_add_color_stop_rgba (reflection_pattern, 0, 1,1,1, active_state() ? 0.4 : 0.2);
- cairo_pattern_add_color_stop_rgba (reflection_pattern, 1, 1,1,1, 0.0);
- }
-
- if (active_state() == Gtkmm2ext::ExplicitActive || ((_tweaks & ImplicitUsesSolidColor) && active_state() == Gtkmm2ext::ImplicitActive)) {
- text_color = text_active_color;
- led_color = led_active_color;
- } else {
- text_color = text_inactive_color;
- led_color = led_inactive_color;
}
-
- UINT_TO_RGBA (text_color, &r, &g, &b, &a);
- text_r = r/255.0;
- text_g = g/255.0;
- text_b = b/255.0;
- text_a = a/255.0;
- UINT_TO_RGBA (led_color, &r, &g, &b, &a);
- led_r = r/255.0;
- led_g = g/255.0;
- led_b = b/255.0;
- led_a = a/255.0;
set_dirty ();
}
@@ -752,14 +659,13 @@ ArdourButton::on_button_press_event (GdkEventButton *ev)
}
}
- if (_tweaks & ShowClick) {
- set_active_state (Gtkmm2ext::ExplicitActive);
- }
+ _grabbed = true;
+ queue_draw ();
if (binding_proxy.button_press_handler (ev)) {
return true;
}
-
+
if (!_act_on_release) {
if (_action) {
_action->activate ();
@@ -781,9 +687,9 @@ ArdourButton::on_button_release_event (GdkEventButton *ev)
}
}
- if (_tweaks & ShowClick) {
- unset_active_state ();
- }
+ _grabbed = false;
+ queue_draw ();
+
if (_hovering) {
signal_clicked ();
@@ -1061,13 +967,6 @@ ArdourButton::action_tooltip_changed ()
}
void
-ArdourButton::set_rounded_corner_mask (int mask)
-{
- _corner_mask = mask;
- queue_draw ();
-}
-
-void
ArdourButton::set_elements (Element e)
{
_elements = e;
diff --git a/gtk2_ardour/ardour_button.h b/gtk2_ardour/ardour_button.h
index 260e0b21ab..d36445d181 100644
--- a/gtk2_ardour/ardour_button.h
+++ b/gtk2_ardour/ardour_button.h
@@ -37,7 +37,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
Body = 0x2,
Text = 0x4,
Indicator = 0x8,
- Inset = 0x10,
+ unused = 0x10,
Menu = 0x20,
};
@@ -53,9 +53,9 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
virtual ~ArdourButton ();
enum Tweaks {
- ShowClick = 0x1,
- NoModel = 0x2,
- ImplicitUsesSolidColor = 0x4,
+ unused1 = 0x1,
+ unused2 = 0x2,
+ unused3 = 0x4,
};
Tweaks tweaks() const { return _tweaks; }
@@ -64,12 +64,13 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
void set_active_state (Gtkmm2ext::ActiveState);
void set_visual_state (Gtkmm2ext::VisualState);
+ void set_act_on_release (bool onRelease) { _act_on_release = onRelease; }
+
Element elements() const { return _elements; }
void set_elements (Element);
void add_elements (Element);
void set_corner_radius (float);
- void set_rounded_corner_mask (int);
void set_diameter (float);
void set_text (const std::string&);
@@ -132,40 +133,22 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
double _angle;
float _xalign, _yalign;
- uint32_t bg_color;
- uint32_t border_color;
- uint32_t fill_start_inactive_color;
- uint32_t fill_end_inactive_color;
- uint32_t fill_start_active_color;
- uint32_t fill_end_active_color;
- uint32_t text_active_color;
- uint32_t text_inactive_color;
- uint32_t led_active_color;
- uint32_t led_inactive_color;
+ uint32_t fill_inactive_color;
+ uint32_t fill_active_color;
+
+ uint32_t text_active_color;
+ uint32_t text_inactive_color;
+
+ uint32_t led_active_color;
+ uint32_t led_inactive_color;
- cairo_pattern_t* fill_pattern;
- cairo_pattern_t* fill_pattern_active;
- cairo_pattern_t* shine_pattern;
+ cairo_pattern_t* convex_pattern;
+ cairo_pattern_t* concave_pattern;
+
cairo_pattern_t* led_inset_pattern;
- cairo_pattern_t* reflection_pattern;
cairo_rectangle_t* _led_rect;
- double text_r;
- double text_g;
- double text_b;
- double text_a;
-
- double led_r;
- double led_g;
- double led_b;
- double led_a;
-
- double active_r;
- double active_g;
- double active_b;
- double active_a;
-
bool _act_on_release;
bool _led_left;
bool _fixed_diameter;
diff --git a/gtk2_ardour/ardour_knob.cc b/gtk2_ardour/ardour_knob.cc
index 92b10a3cea..de99946763 100644
--- a/gtk2_ardour/ardour_knob.cc
+++ b/gtk2_ardour/ardour_knob.cc
@@ -118,10 +118,10 @@ ArdourKnob::render (cairo_t* cr, cairo_rectangle_t *)
//look up the arc colors from the config
double red_start, green_start, blue_start, unused;
- ArdourCanvas::Color arc_start_color = ARDOUR_UI::config()->color_by_name ( "processor fader: fill start");
+ ArdourCanvas::Color arc_start_color = ARDOUR_UI::config()->color_by_name ( string_compose ("%1: arc start", get_name()));
ArdourCanvas::color_to_rgba( arc_start_color, red_start, green_start, blue_start, unused );
double red_end, green_end, blue_end;
- ArdourCanvas::Color arc_end_color = ARDOUR_UI::config()->color_by_name ( "processor fader: fill end" );
+ ArdourCanvas::Color arc_end_color = ARDOUR_UI::config()->color_by_name ( string_compose ("%1: arc end", get_name()) );
ArdourCanvas::color_to_rgba( arc_end_color, red_end, green_end, blue_end, unused );
//vary the arc color over the travel of the knob
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 1b842de30a..73982bb436 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -265,10 +265,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
rec_button.set_name ("transport recenable button");
midi_panic_button.set_name ("transport button");
- goto_start_button.set_tweaks (ArdourButton::ShowClick);
- goto_end_button.set_tweaks (ArdourButton::ShowClick);
- midi_panic_button.set_tweaks (ArdourButton::ShowClick);
-
last_configure_time= 0;
last_peak_grab = 0;
@@ -1133,8 +1129,7 @@ ARDOUR_UI::every_point_zero_something_seconds ()
float mpeak = editor_meter->update_meters();
if (mpeak > editor_meter_max_peak) {
if (mpeak >= Config->get_meter_peak()) {
- editor_meter_peak_display.set_name ("meterbridge peakindicator on");
- editor_meter_peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
+ editor_meter_peak_display.set_active_state ( Gtkmm2ext::ExplicitActive );
}
}
}
@@ -2482,7 +2477,7 @@ ARDOUR_UI::transport_rec_enable_blink (bool onoff)
if (onoff) {
rec_button.set_active_state (Gtkmm2ext::ExplicitActive);
} else {
- rec_button.set_active_state (Gtkmm2ext::ImplicitActive);
+ rec_button.set_active_state (Gtkmm2ext::Off);
}
} else if (r == Session::Recording && h) {
rec_button.set_active_state (Gtkmm2ext::ExplicitActive);
@@ -4416,8 +4411,7 @@ ARDOUR_UI::reset_peak_display ()
if (!_session || !_session->master_out() || !editor_meter) return;
editor_meter->clear_meters();
editor_meter_max_peak = -INFINITY;
- editor_meter_peak_display.set_name ("meterbridge peakindicator");
- editor_meter_peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
+ editor_meter_peak_display.set_active_state ( Gtkmm2ext::Off );
}
void
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index 9456a11b64..bd06f346f8 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -145,7 +145,7 @@ ARDOUR_UI::setup_tooltips ()
set_tip (feedback_alert_button, _("When active, there is a feedback loop."));
set_tip (primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
set_tip (secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
- set_tip (editor_meter_peak_display, _("Reset Level Meter"));
+ set_tip (editor_meter_peak_display, _("Reset All Peak Indicators"));
synchronize_sync_source_and_video_pullup ();
diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc
index 6fef5b94e4..f23e91069e 100644
--- a/gtk2_ardour/ardour_ui_dialogs.cc
+++ b/gtk2_ardour/ardour_ui_dialogs.cc
@@ -222,10 +222,9 @@ ARDOUR_UI::set_session (Session *s)
ArdourMeter::ResetGroupPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_group_peak_display));
editor_meter_peak_display.set_name ("meterbridge peakindicator");
- editor_meter_peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
editor_meter_peak_display.unset_flags (Gtk::CAN_FOCUS);
- editor_meter_peak_display.set_size_request(6, -1);
- editor_meter_peak_display.set_corner_radius(2);
+ editor_meter_peak_display.set_size_request(10, -1);
+ editor_meter_peak_display.set_corner_radius(1);
editor_meter_max_peak = -INFINITY;
editor_meter_peak_display.signal_button_release_event().connect (sigc::mem_fun(*this, &ARDOUR_UI::editor_meter_peak_button_release), false);
@@ -571,7 +570,7 @@ ARDOUR_UI::editor_meter_peak_button_release (GdkEventButton* ev)
} else if (_session->master_out()) {
ArdourMeter::ResetRoutePeakDisplays (_session->master_out().get());
}
- return true;
+ return false;
}
void
diff --git a/gtk2_ardour/canvas_vars.h b/gtk2_ardour/canvas_vars.h
index 4277149a35..6d44073428 100644
--- a/gtk2_ardour/canvas_vars.h
+++ b/gtk2_ardour/canvas_vars.h
@@ -90,13 +90,6 @@ CANVAS_VARIABLE(canvasvar_MidiMeterColor8, "midi meter fill: 8")
CANVAS_VARIABLE(canvasvar_MidiMeterColor9, "midi meter fill: 9")
CANVAS_VARIABLE(canvasvar_MeterBackgroundBot, "meter background: bottom")
CANVAS_VARIABLE(canvasvar_MeterBackgroundTop, "meter background: top")
-CANVAS_VARIABLE(canvasvar_MeterBridgePeakindicatorOffFillStart, "meterbridge peakindicator: fill start")
-CANVAS_VARIABLE(canvasvar_MeterBridgePeakindicatorOffFillEnd, "meterbridge peakindicator: fill end")
-CANVAS_VARIABLE(canvasvar_MeterBridgePeakindicatorOnFillStart, "meterbridge peakindicator on: fill start")
-CANVAS_VARIABLE(canvasvar_MeterBridgePeakindicatorOnFillEnd, "meterbridge peakindicator on: fill end")
-CANVAS_VARIABLE(canvasvar_MeterBridgeLabelFillStart, "meterbridge label: fill start")
-CANVAS_VARIABLE(canvasvar_MeterBridgeLabelFillEnd, "meterbridge label: fill end")
-CANVAS_VARIABLE(canvasvar_MeterBridgeLabelText, "meterbridge label: text")
CANVAS_VARIABLE(canvasvar_MeterMarker, "meter marker")
CANVAS_VARIABLE(canvasvar_MidiBusBase, "midi bus base")
CANVAS_VARIABLE(canvasvar_MidiFrameBase, "midi frame base")
@@ -170,9 +163,8 @@ CANVAS_VARIABLE(canvasvar_TimeAxisFrame, "time axis frame")
CANVAS_VARIABLE(canvasvar_SelectedTimeAxisFrame, "selected time axis frame")
CANVAS_VARIABLE(canvasvar_TimeStretchFill, "time stretch fill")
CANVAS_VARIABLE(canvasvar_TimeStretchOutline, "time stretch outline")
-CANVAS_VARIABLE(canvasvar_TrackNumberLabelFillStart, "tracknumber label: fill start")
-CANVAS_VARIABLE(canvasvar_TrackNumberLabelFillEnd, "tracknumber label: fill end")
-CANVAS_VARIABLE(canvasvar_TrackNumberLabelText, "tracknumber label: text")
+CANVAS_VARIABLE(canvasvar_MonitorKnobArcStart, "monitor knob: arc start")
+CANVAS_VARIABLE(canvasvar_MonitorKnobArcEnd, "monitor knob: arc end")
CANVAS_VARIABLE(canvasvar_TransportDragRect, "transport drag rect")
CANVAS_VARIABLE(canvasvar_TransportLoopRect, "transport loop rect")
CANVAS_VARIABLE(canvasvar_TransportMarkerBar, "transport marker bar")
@@ -193,10 +185,8 @@ CANVAS_VARIABLE(canvasvar_MonitorSectionKnob, "monitor knob")
CANVAS_VARIABLE(canvasvar_ButtonBorder, "border color")
#define BUTTON_VARS(root,name) \
-CANVAS_VARIABLE(canvasvar_ ## root ## FillStart, name ": fill start") \
-CANVAS_VARIABLE(canvasvar_ ## root ## FillEnd, name ": fill end") \
-CANVAS_VARIABLE(canvasvar_ ## root ## FillStartActive, name ": fill start active") \
-CANVAS_VARIABLE(canvasvar_ ## root ## FillEndActive, name ": fill end active") \
+CANVAS_VARIABLE(canvasvar_ ## root ## Fill, name ": fill") \
+CANVAS_VARIABLE(canvasvar_ ## root ## FillActive, name ": fill active") \
CANVAS_VARIABLE(canvasvar_ ## root ## LED, name ": led") \
CANVAS_VARIABLE(canvasvar_ ## root ## LEDActive, name ": led active") \
CANVAS_VARIABLE(canvasvar_ ## root ## Text, name ": text") \
@@ -210,6 +200,8 @@ BUTTON_VARS(MonitorButton, "monitor button")
BUTTON_VARS(SoloIsolateButton, "solo isolate")
BUTTON_VARS(SoloSafeButton, "solo safe")
BUTTON_VARS(MidiDeviceButton, "midi device")
+BUTTON_VARS(MeterBridgePeakIndicator, "meterbridge peakindicator")
+BUTTON_VARS(MeterBridgeLabel, "meterbridge label")
BUTTON_VARS(MonitorSectionCutButton, "monitor section cut")
BUTTON_VARS(MonitorSectionDimButton, "monitor section dim")
BUTTON_VARS(MonitorSectionSoloButton, "monitor section solo")
@@ -231,6 +223,7 @@ BUTTON_VARS(TransportButton, "transport button")
BUTTON_VARS(TransportRecenableButton, "transport recenable button")
BUTTON_VARS(TransportOptionButton, "transport option button")
BUTTON_VARS(TransportActiveOptionButton, "transport active option button")
+BUTTON_VARS(TrackNumberLabel, "tracknumber label")
BUTTON_VARS(PluginBypassButton, "plugin bypass button")
BUTTON_VARS(PunchButton, "punch button")
BUTTON_VARS(MouseModeButton, "mouse mode button")
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 692f4efff0..a365b6a7a1 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -673,11 +673,9 @@ Editor::Editor ()
/* nudge stuff */
nudge_forward_button.set_name ("nudge button");
-// nudge_forward_button.add_elements (ArdourButton::Inset);
nudge_forward_button.set_image(::get_icon("nudge_right"));
nudge_backward_button.set_name ("nudge button");
-// nudge_backward_button.add_elements (ArdourButton::Inset);
nudge_backward_button.set_image(::get_icon("nudge_left"));
fade_context_menu.set_name ("ArdourContextMenu");
@@ -2881,28 +2879,21 @@ Editor::setup_toolbar ()
zoom_preset_selector.set_size_request (42, -1);
zoom_in_button.set_name ("zoom button");
-// zoom_in_button.add_elements ( ArdourButton::Inset );
- zoom_in_button.set_tweaks ((ArdourButton::Tweaks) (ArdourButton::ShowClick) );
zoom_in_button.set_image(::get_icon ("zoom_in"));
act = ActionManager::get_action (X_("Editor"), X_("temporal-zoom-in"));
zoom_in_button.set_related_action (act);
zoom_out_button.set_name ("zoom button");
-// zoom_out_button.add_elements ( ArdourButton::Inset );
- zoom_out_button.set_tweaks ((ArdourButton::Tweaks) (ArdourButton::ShowClick) );
zoom_out_button.set_image(::get_icon ("zoom_out"));
act = ActionManager::get_action (X_("Editor"), X_("temporal-zoom-out"));
zoom_out_button.set_related_action (act);
zoom_out_full_button.set_name ("zoom button");
-// zoom_out_full_button.add_elements ( ArdourButton::Inset );
- zoom_out_full_button.set_tweaks ((ArdourButton::Tweaks) (ArdourButton::ShowClick) );
zoom_out_full_button.set_image(::get_icon ("zoom_full"));
act = ActionManager::get_action (X_("Editor"), X_("zoom-to-session"));
zoom_out_full_button.set_related_action (act);
zoom_focus_selector.set_name ("zoom button");
-// zoom_focus_selector.add_elements (ArdourButton::Inset);
if (ARDOUR::Profile->get_mixbus()) {
_zoom_box.pack_start (zoom_preset_selector, false, false);
@@ -2918,7 +2909,6 @@ Editor::setup_toolbar ()
/* Track zoom buttons */
visible_tracks_selector.set_name ("zoom button");
-// visible_tracks_selector.add_elements ( ArdourButton::Inset );
if (Profile->get_mixbus()) {
visible_tracks_selector.set_image(::get_icon ("tav_exp"));
visible_tracks_selector.set_size_request (42, -1);
@@ -2927,16 +2917,12 @@ Editor::setup_toolbar ()
}
tav_expand_button.set_name ("zoom button");
-// tav_expand_button.add_elements ( ArdourButton::FlatFace );
- tav_expand_button.set_tweaks ((ArdourButton::Tweaks) (ArdourButton::ShowClick) );
tav_expand_button.set_size_request (-1, 20);
tav_expand_button.set_image(::get_icon ("tav_exp"));
act = ActionManager::get_action (X_("Editor"), X_("expand-tracks"));
tav_expand_button.set_related_action (act);
tav_shrink_button.set_name ("zoom button");
-// tav_shrink_button.add_elements ( ArdourButton::FlatFace );
- tav_shrink_button.set_tweaks ((ArdourButton::Tweaks) (ArdourButton::ShowClick) );
tav_shrink_button.set_size_request (-1, 20);
tav_shrink_button.set_image(::get_icon ("tav_shrink"));
act = ActionManager::get_action (X_("Editor"), X_("shrink-tracks"));
@@ -2992,9 +2978,6 @@ Editor::setup_toolbar ()
nudge_forward_button.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::nudge_forward_release), false);
nudge_backward_button.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::nudge_backward_release), false);
- nudge_forward_button.set_tweaks ((ArdourButton::Tweaks) (ArdourButton::ShowClick) );
- nudge_backward_button.set_tweaks ((ArdourButton::Tweaks) (ArdourButton::ShowClick) );
-
nudge_box->pack_start (nudge_backward_button, false, false);
nudge_box->pack_start (nudge_forward_button, false, false);
nudge_box->pack_start (*nudge_clock, false, false);
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index 025633b090..8372287509 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -679,12 +679,12 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
t->RecordEnableChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_rec_display, this), gui_context());
}
- if ((*x)->is_midi_track()) {
- boost::shared_ptr<MidiTrack> t = boost::dynamic_pointer_cast<MidiTrack> ((*x)->route());
+ if ((*x)->is_midi_track()) {
+ boost::shared_ptr<MidiTrack> t = boost::dynamic_pointer_cast<MidiTrack> ((*x)->route());
t->StepEditStatusChange.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_rec_display, this), gui_context());
- t->InputActiveChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_input_active_display, this), gui_context());
- }
-
+ t->InputActiveChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_input_active_display, this), gui_context());
+ }
+
(*x)->route()->mute_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_mute_display, this), gui_context());
(*x)->route()->solo_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_display, this, _1), gui_context());
(*x)->route()->listen_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_display, this, _1), gui_context());
diff --git a/gtk2_ardour/meter_strip.cc b/gtk2_ardour/meter_strip.cc
index fd38da65e6..6c1b110356 100644
--- a/gtk2_ardour/meter_strip.cc
+++ b/gtk2_ardour/meter_strip.cc
@@ -154,6 +154,7 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
// peak display
peak_display.set_name ("meterbridge peakindicator");
peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
+ ARDOUR_UI::instance()->set_tip (peak_display, _("Reset Peak"));
max_peak = minus_infinity();
peak_display.unset_flags (Gtk::CAN_FOCUS);
peak_display.set_size_request(12, 8);
@@ -205,7 +206,6 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
rec_enable_button->set_corner_radius(2);
rec_enable_button->set_size_request(16, 16);
- rec_enable_button->set_image (::get_icon (X_("record_normal_red")));
mute_button->set_corner_radius(2);
mute_button->set_size_request(16, 16);
@@ -340,9 +340,9 @@ MeterStrip::set_session (Session* s)
}
void
-MeterStrip::update_rec_display ()
+MeterStrip::blink_rec_display (bool onoff)
{
- RouteUI::update_rec_display ();
+ RouteUI::blink_rec_display (onoff);
}
std::string
@@ -394,14 +394,20 @@ MeterStrip::strip_property_changed (const PropertyChange& what_changed)
}
void
+MeterStrip::route_color_changed ()
+{
+ number_label.set_fixed_colors (gdk_color_to_rgba (color()), gdk_color_to_rgba (color()));
+}
+
+
+void
MeterStrip::fast_update ()
{
float mpeak = level_meter->update_meters();
if (mpeak > max_peak) {
max_peak = mpeak;
if (mpeak >= Config->get_meter_peak()) {
- peak_display.set_name ("meterbridge peakindicator on");
- peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
+ peak_display.set_active_state ( Gtkmm2ext::ExplicitActive );
}
}
}
@@ -645,8 +651,7 @@ MeterStrip::reset_peak_display ()
_route->shared_peak_meter()->reset_max();
level_meter->clear_meters();
max_peak = -INFINITY;
- peak_display.set_name ("meterbridge peakindicator");
- peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
+ peak_display.set_active_state ( Gtkmm2ext::Off );
}
bool
@@ -661,7 +666,7 @@ MeterStrip::peak_button_release (GdkEventButton* ev)
} else {
ResetRoutePeakDisplays (_route.get());
}
- return true;
+ return false;
}
void
diff --git a/gtk2_ardour/meter_strip.h b/gtk2_ardour/meter_strip.h
index 0ccf21d60c..d8370b45f0 100644
--- a/gtk2_ardour/meter_strip.h
+++ b/gtk2_ardour/meter_strip.h
@@ -88,7 +88,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
void on_size_request (Gtk::Requisition*);
/* route UI */
- void update_rec_display ();
+ void blink_rec_display (bool onoff);
std::string state_id() const;
void set_button_names ();
@@ -142,6 +142,8 @@ class MeterStrip : public Gtk::VBox, public RouteUI
void update_button_box ();
void update_name_box ();
void name_changed ();
+
+ void route_color_changed ();
bool _suspend_menu_callbacks;
bool level_meter_button_release (GdkEventButton* ev);
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 7352198e45..a7f8360ef7 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -324,12 +324,16 @@ MixerStrip::init ()
_session->engine().Running.connect (*this, invalidator (*this), boost::bind (&MixerStrip::engine_running, this), gui_context());
input_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::input_press), false);
- output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false);
+ input_button.signal_button_release_event().connect (sigc::mem_fun(*this, &MixerStrip::input_release), false);
- /* ditto for this button and busses */
+ output_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::output_press), false);
+ output_button.signal_button_release_event().connect (sigc::mem_fun(*this, &MixerStrip::output_release), false);
number_label.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::number_button_button_press), false);
+
name_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_press), false);
+ name_button.signal_button_release_event().connect (sigc::mem_fun(*this, &MixerStrip::name_button_button_release), false);
+
group_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::select_route_group), false);
_width = (Width) -1;
@@ -760,6 +764,18 @@ struct RouteCompareByName {
};
gint
+MixerStrip::output_release (GdkEventButton *ev)
+{
+ switch (ev->button) {
+ case 1:
+ edit_output_configuration ();
+ break;
+ }
+
+ return false;
+}
+
+gint
MixerStrip::output_press (GdkEventButton *ev)
{
using namespace Menu_Helpers;
@@ -773,8 +789,7 @@ MixerStrip::output_press (GdkEventButton *ev)
switch (ev->button) {
case 1:
- edit_output_configuration ();
- break;
+ return false; //wait for the mouse-up to pop the dialog
case 3:
{
@@ -837,6 +852,23 @@ MixerStrip::output_press (GdkEventButton *ev)
}
gint
+MixerStrip::input_release (GdkEventButton *ev)
+{
+ switch (ev->button) {
+
+ case 1:
+ edit_input_configuration ();
+ break;
+ default:
+ break;
+
+ }
+
+ return false;
+}
+
+
+gint
MixerStrip::input_press (GdkEventButton *ev)
{
using namespace Menu_Helpers;
@@ -857,8 +889,7 @@ MixerStrip::input_press (GdkEventButton *ev)
switch (ev->button) {
case 1:
- edit_input_configuration ();
- break;
+ return false; //don't handle the mouse-down here. wait for mouse-up to pop the menu
case 3:
{
@@ -1479,11 +1510,23 @@ MixerStrip::build_route_ops_menu ()
gboolean
MixerStrip::name_button_button_press (GdkEventButton* ev)
{
- /* show menu for either button 1 or 3, so as not to confuse people
- and also not hide stuff from them.
- */
+ if (ev->button == 3) {
+ list_route_operations ();
+
+ /* do not allow rename if the track is record-enabled */
+ rename_menu_item->set_sensitive (!_route->record_enabled());
+ route_ops_menu->popup (1, ev->time);
- if (ev->button == 3 || ev->button == 1) {
+ return true;
+ }
+
+ return false;
+}
+
+gboolean
+MixerStrip::name_button_button_release (GdkEventButton* ev)
+{
+ if (ev->button == 1) {
list_route_operations ();
/* do not allow rename if the track is record-enabled */
@@ -1503,6 +1546,8 @@ MixerStrip::number_button_button_press (GdkEventButton* ev)
/* do not allow rename if the track is record-enabled */
rename_menu_item->set_sensitive (!_route->record_enabled());
route_ops_menu->popup (1, ev->time);
+
+ return true;
}
return false;
@@ -1914,7 +1959,7 @@ MixerStrip::set_button_names ()
{
switch (_width) {
case Wide:
- rec_enable_button->set_text (_("Rec"));
+// rec_enable_button->set_text (_("Rec"));
mute_button->set_text (_("Mute"));
monitor_input_button->set_text (_("In"));
monitor_disk_button->set_text (_("Disk"));
@@ -1941,7 +1986,7 @@ MixerStrip::set_button_names ()
break;
default:
- rec_enable_button->set_text (_("R"));
+// rec_enable_button->set_text (_("R"));
mute_button->set_text (_("M"));
monitor_input_button->set_text (_("I"));
monitor_disk_button->set_text (_("D"));
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index 464a49da63..bd3c3a289b 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -205,7 +205,10 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
RouteGroupMenu *group_menu;
gint input_press (GdkEventButton *);
+ gint input_release (GdkEventButton *);
+
gint output_press (GdkEventButton *);
+ gint output_release (GdkEventButton *);
Gtk::Menu input_menu;
std::list<boost::shared_ptr<ARDOUR::Bundle> > input_menu_bundles;
@@ -242,6 +245,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
Gtk::Menu* route_ops_menu;
void build_route_ops_menu ();
gboolean name_button_button_press (GdkEventButton*);
+ gboolean name_button_button_release (GdkEventButton*);
gboolean number_button_button_press (GdkEventButton*);
void list_route_operations ();
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index e819f9ec44..b31299a3ec 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -149,7 +149,6 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
mute_changed (0);
update_solo_display ();
- route_color_changed();
timestretch_rect = 0;
no_redraw = false;
@@ -2276,9 +2275,9 @@ RouteTimeAxisView::can_edit_name () const
}
void
-RouteTimeAxisView::update_rec_display ()
+RouteTimeAxisView::blink_rec_display (bool onoff)
{
- RouteUI::update_rec_display ();
+ RouteUI::blink_rec_display (onoff);
}
void
diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h
index cfc71d89fa..8e0941d591 100644
--- a/gtk2_ardour/route_time_axis.h
+++ b/gtk2_ardour/route_time_axis.h
@@ -208,7 +208,7 @@ protected:
void route_property_changed (const PBD::PropertyChange&);
void name_entry_changed ();
- void update_rec_display ();
+ void blink_rec_display (bool onoff);
virtual void label_view ();
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index a9d63a53b5..a413c0d3e0 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -79,6 +79,7 @@ RouteUI::RouteUI (ARDOUR::Session* sess)
, comment_window(0)
, input_selector (0)
, output_selector (0)
+ , comment_area(0)
, _invert_menu(0)
{
if (sess) init ();
@@ -97,6 +98,9 @@ RouteUI::~RouteUI()
delete input_selector;
delete output_selector;
delete _invert_menu;
+
+ send_blink_connection.disconnect ();
+ rec_blink_connection.disconnect ();
}
void
@@ -140,9 +144,11 @@ RouteUI::init ()
rec_enable_button = manage (new ArdourButton);
rec_enable_button->set_name ("record enable button");
-// rec_enable_button->set_tweaks (ArdourButton::ImplicitUsesSolidColor);
+ rec_enable_button->set_image (::get_icon (X_("record_normal_red")));
UI::instance()->set_tip (rec_enable_button, _("Enable recording on this track"), "");
+ rec_blink_connection = ARDOUR_UI::instance()->Blink.connect (sigc::mem_fun (*this, &RouteUI::blink_rec_display));
+
show_sends_button = manage (new ArdourButton);
show_sends_button->set_name ("send alert button");
UI::instance()->set_tip (show_sends_button, _("make mixer strips show sends to this bus"), "");
@@ -268,8 +274,6 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
set up the name entry/name label display.
*/
- update_rec_display ();
-
if (is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route);
t->MonitoringChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::monitoring_changed, this), gui_context());
@@ -298,6 +302,8 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
update_mute_display ();
update_solo_display ();
+
+ route_color_changed();
}
void
@@ -326,6 +332,8 @@ RouteUI::mute_press (GdkEventButton* ev)
}
mute_menu->popup(0,ev->time);
+
+ return true;
} else {
@@ -333,7 +341,7 @@ RouteUI::mute_press (GdkEventButton* ev)
// Primary-button2 click is the midi binding click
// button2-click is "momentary"
-
+ //give the button a chance to handle a midi binding
if (mute_button->on_button_press_event (ev)) {
return true;
}
@@ -415,11 +423,11 @@ RouteUI::mute_press (GdkEventButton* ev)
}
}
- return true;
+ return false;
}
bool
-RouteUI::mute_release (GdkEventButton*)
+RouteUI::mute_release (GdkEventButton *ev)
{
if (_mute_release){
DisplaySuspender ds;
@@ -428,7 +436,7 @@ RouteUI::mute_release (GdkEventButton*)
_mute_release = 0;
}
- return true;
+ return false;
}
void
@@ -504,13 +512,12 @@ RouteUI::solo_press(GdkEventButton* ev)
if (Keyboard::is_button2_event (ev)) {
- // Primary-button2 click is the midi binding click
- // button2-click is "momentary"
-
+ // Give the button a chance to handle MIDI binding
if (solo_button->on_button_press_event (ev)) {
return true;
}
+ // button2-click is "momentary"
_solo_release = new SoloMuteRelease (_route->self_soloed());
}
@@ -619,11 +626,11 @@ RouteUI::solo_press(GdkEventButton* ev)
}
}
- return true;
+ return false;
}
bool
-RouteUI::solo_release (GdkEventButton*)
+RouteUI::solo_release (GdkEventButton *ev)
{
if (_solo_release) {
@@ -642,7 +649,7 @@ RouteUI::solo_release (GdkEventButton*)
_solo_release = 0;
}
- return true;
+ return false;
}
bool
@@ -655,7 +662,7 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
if (!_session->engine().connected()) {
MessageDialog msg (_("Not connected to AudioEngine - cannot engage record"));
msg.run ();
- return true;
+ return false;
}
if (is_midi_track()) {
@@ -664,21 +671,21 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
if (midi_track()->step_editing()) {
midi_track()->set_step_editing (false);
- return true;
+ return false;
}
}
if (is_track() && rec_enable_button) {
if (Keyboard::is_button2_event (ev)) {
-
- // do nothing on midi sigc::bind event
- return rec_enable_button->on_button_press_event (ev);
+
+ //rec arm does not have a momentary mode
+ return false;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
DisplaySuspender ds;
- _session->set_record_enabled (_session->get_routes(), !rec_enable_button->active_state());
+ _session->set_record_enabled (_session->get_routes(), !_route->record_enabled());
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
@@ -700,7 +707,7 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
}
DisplaySuspender ds;
- _session->set_record_enabled (rl, !rec_enable_button->active_state(), Session::rt_cleanup, true);
+ _session->set_record_enabled (rl, !_route->record_enabled(), Session::rt_cleanup, true);
}
} else if (Keyboard::is_context_menu_event (ev)) {
@@ -712,11 +719,11 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
boost::shared_ptr<RouteList> rl (new RouteList);
rl->push_back (route());
DisplaySuspender ds;
- _session->set_record_enabled (rl, !rec_enable_button->active_state());
+ _session->set_record_enabled (rl, !_route->record_enabled());
}
}
- return true;
+ return false;
}
void
@@ -909,10 +916,10 @@ RouteUI::rec_enable_release (GdkEventButton* ev)
if (record_menu) {
record_menu->popup (1, ev->time);
}
- return true;
+ return false;
}
- return true;
+ return false;
}
void
@@ -1220,19 +1227,18 @@ RouteUI::update_mute_display ()
void
RouteUI::route_rec_enable_changed ()
{
- update_rec_display ();
+ blink_rec_display(true); //this lets the button change "immediately" rather than wait for the next blink
update_monitoring_display ();
}
void
RouteUI::session_rec_enable_changed ()
{
- update_rec_display ();
update_monitoring_display ();
}
void
-RouteUI::update_rec_display ()
+RouteUI::blink_rec_display (bool blinkOn)
{
if (!rec_enable_button || !_route) {
return;
@@ -1246,7 +1252,10 @@ RouteUI::update_rec_display ()
case Session::Disabled:
case Session::Enabled:
- rec_enable_button->set_active_state (Gtkmm2ext::ImplicitActive);
+ if ( false ) //TODO: Need a blink option
+ rec_enable_button->set_active_state ( blinkOn ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off );
+ else
+ rec_enable_button->set_active_state ( ImplicitActive );
break;
}
@@ -1710,6 +1719,8 @@ RouteUI::comment_changed (void *src)
void
RouteUI::comment_editor_done_editing ()
{
+ ENSURE_GUI_THREAD (*this, &MixerStrip::comment_editor_done_editing, src)
+
string const str = comment_area->get_buffer()->get_text();
if (str == _route->comment ()) {
return;
@@ -2084,7 +2095,7 @@ RouteUI::invert_press (GdkEventButton* ev)
up a menu on right-click; left click is handled
on release.
*/
- return true;
+ return false;
}
delete _invert_menu;
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index 28d0f77d1b..708f616f6d 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -115,6 +115,8 @@ class RouteUI : public virtual AxisView
void send_blink (bool);
sigc::connection send_blink_connection;
+ sigc::connection rec_blink_connection;
+
Gtk::Menu* mute_menu;
Gtk::Menu* solo_menu;
Gtk::Menu* sends_menu;
@@ -213,7 +215,7 @@ class RouteUI : public virtual AxisView
void disconnect_input ();
void disconnect_output ();
- virtual void update_rec_display ();
+ virtual void blink_rec_display (bool onoff);
void update_mute_display ();
void update_solo_display ();