<table><tr><td style="">broulik added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D11021">View Revision</a></tr></table><br /><div><div><p>Thanks for your patch! I thought about doing that for a long time, actually.<br />
You can add <tt style="background: #ebebeb; font-size: 13px;">BUG: 386588</tt> to your commit message (on its own line) to indiate that it fixes this bug.</p>

<p>Can you please also implement a volume OSD? We have a mediaPlayerVolumeChanged in plasmashell OSD service but never used it. I think this could be done in the <tt style="background: #ebebeb; font-size: 13px;">SetVolume</tt> operation by adding a new argument <tt style="background: #ebebeb; font-size: 13px;">showOsd</tt> or so that you then set. To implement an OSD you just need to place a DBus call like so:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">QDBusMessage msg = QDBusMessage::createMethodCall(
    QStringLiteral("org.kde.plasmashell"),
    QStringLiteral("/org/kde/osdService"),
    QStringLiteral("org.kde.osdService"),
    QStringLiteral("mediaPlayerVolumeChanged")
);

msg.setArguments({
    50, // volume in percent (0-100)
    user visible player name (identity), // "VLC media player"
    icon name of player // "vlc"
});

QDBusConnection::sessionBus().asyncCall(msg);</pre></div></div></div><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11021#inline-53399">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:153</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #aa4000">var</span> <span style="color: #004012">volume</span> <span style="color: #aa2211">=</span> <span style="color: #004012">mpris2Source</span><span class="p">.</span><span style="color: #004012">currentData</span><span class="p">.</span><span style="color: #004012">Volume</span> <span style="color: #aa2211">||</span> <span style="color: #601200">0.0</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #004012">volume</span> <span style="color: #aa2211">+=</span> <span class="p">(</span><span style="color: #004012">wheel</span><span class="p">.</span><span style="color: #004012">angleDelta</span><span class="p">.</span><span style="color: #004012">y</span> <span style="color: #aa2211">/</span> <span style="color: #601200">120</span><span class="p">)</span> <span style="color: #aa2211">*</span> <span style="color: #601200">0.03</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #004012">volume</span> <span style="color: #aa2211"><</span> <span style="color: #601200">0</span><span class="p">)</span> <span style="color: #004012">volume</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0.0</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Did you check this works fine with touchpads? Here Qt sends a gazillion of tiny wheel events.</p>

<p style="padding: 0; margin: 8px;">Please enforce a limit of e.g. 100%, I almost deafened myself last time I messed with volume on Mpris</p></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11021#inline-53400">View Inline</a><span style="color: #4b4d51; font-weight: bold;">main.qml:154</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #004012">volume</span> <span style="color: #aa2211">+=</span> <span class="p">(</span><span style="color: #004012">wheel</span><span class="p">.</span><span style="color: #004012">angleDelta</span><span class="p">.</span><span style="color: #004012">y</span> <span style="color: #aa2211">/</span> <span style="color: #601200">120</span><span class="p">)</span> <span style="color: #aa2211">*</span> <span style="color: #601200">0.03</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #004012">volume</span> <span style="color: #aa2211"><</span> <span style="color: #601200">0</span><span class="p">)</span> <span style="color: #004012">volume</span> <span style="color: #aa2211">=</span> <span style="color: #601200">0.0</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #aa4000">var</span> <span style="color: #004012">service</span> <span style="color: #aa2211">=</span> <span style="color: #004012">mpris2Source</span><span class="p">.</span><span style="color: #004012">serviceForSource</span><span class="p">(</span><span style="color: #004012">mpris2Source</span><span class="p">.</span><span style="color: #004012">current</span><span class="p">)</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">volume = Math.max(0, volume);</pre></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11021#inline-53402">View Inline</a><span style="color: #4b4d51; font-weight: bold;">multiplexedservice.cpp:136</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span style="color: #aa4000">if</span> <span class="p">(</span><span class="n">m_control</span><span class="p">)</span> <span class="p">{</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #aa4000">double</span> <span class="n">vol</span> <span style="color: #aa2211">=</span> <span class="n">m_control</span><span style="color: #aa2211">-></span><span class="n">playerInterface</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">volume</span><span class="p">()</span> <span style="color: #aa2211">+</span> <span style="color: #601200">0.05</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="n">m_control</span><span style="color: #aa2211">-></span><span class="n">playerInterface</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">setVolume</span><span class="p">(</span><span class="n">vol</span><span class="p">);</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">No need to abbreviate</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">const qreal newVolume = ...</pre></div></div></div><br /><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D11021#inline-53401">View Inline</a><span style="color: #4b4d51; font-weight: bold;">multiplexedservice.cpp:137</span></div>
<div style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; white-space: pre-wrap; clear: both; padding: 4px 0; margin: 0;"><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span style="color: #aa4000">double</span> <span class="n">vol</span> <span style="color: #aa2211">=</span> <span class="n">m_control</span><span style="color: #aa2211">-></span><span class="n">playerInterface</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">volume</span><span class="p">()</span> <span style="color: #aa2211">+</span> <span style="color: #601200">0.05</span><span class="p">;</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">                <span class="n">m_control</span><span style="color: #aa2211">-></span><span class="n">playerInterface</span><span class="p">()</span><span style="color: #aa2211">-></span><span class="n">setVolume</span><span class="p">(</span><span class="n">vol</span><span class="p">);</span>
</div><div style="padding: 0 8px; margin: 0 4px; background: rgba(151, 234, 151, .6);">            <span class="p">}</span>
</div></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Also enforce a limit here,</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">qBound(0.0, vol, 1.0);</pre></div></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11021">https://phabricator.kde.org/D11021</a></div></div><br /><div><strong>To: </strong>Pitel, Plasma<br /><strong>Cc: </strong>broulik, nicolasfella, plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>