Mercurial > mplayer.hg
comparison gui/interface.c @ 36934:28401584d792
Use the new internal event to set volume.
This avoids duplicate code.
author | ib |
---|---|
date | Fri, 21 Mar 2014 14:49:13 +0000 |
parents | d762d49a47e0 |
children | 9afababf229e |
comparison
equal
deleted
inserted
replaced
36933:fec1a036882c | 36934:28401584d792 |
---|---|
749 | 749 |
750 mixer_getbalance(mixer, &b); | 750 mixer_getbalance(mixer, &b); |
751 guiInfo.Balance = (b + 1.0) * 50.0; // transform -1..1 to 0..100 | 751 guiInfo.Balance = (b + 1.0) * 50.0; // transform -1..1 to 0..100 |
752 | 752 |
753 if (guiInfo.Balance != last_balance) { | 753 if (guiInfo.Balance != last_balance) { |
754 l = guiInfo.Volume * (100.0 - guiInfo.Balance) / 50.0; | 754 uiEvent(ivSetVolume, guiInfo.Volume); |
755 r = guiInfo.Volume * guiInfo.Balance / 50.0; | |
756 mixer_setvolume(mixer, FFMIN(l, guiInfo.Volume), FFMIN(r, guiInfo.Volume)); | |
757 last_balance = guiInfo.Balance; | 755 last_balance = guiInfo.Balance; |
758 } | 756 } |
759 } | 757 } |
760 | 758 |
761 break; | 759 break; |