more id3v2 fixes
[amper.git] / amperopts.d
blob7dd8c5732f8748c6496406ed3954db7f6c08f60b
1 /* coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
2 * Understanding is not required. Only obedience.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 module amperopts;
19 import core.time;
21 import arsd.color;
22 import arsd.image;
23 import arsd.simpledisplay;
25 import iv.cmdcon;
26 import iv.cmdcongl;
27 import iv.strex;
28 import iv.vfs.io;
30 import aplayer;
32 import egfx;
35 // ////////////////////////////////////////////////////////////////////////// //
36 public __gshared EgfxWindow sdampwin;
37 public __gshared EgfxWindow sdplwin;
38 public __gshared EgfxWindow sdeqwin;
40 public void delegate () dgCreatePListWindow;
41 public void delegate () dgCreateEqWindow;
44 // ////////////////////////////////////////////////////////////////////////// //
45 //__gshared string skinfile = "skins/WastedAMP1-0.zip";
46 //__gshared string skinfile = "skins/winamp2.zip";
47 //public __gshared string skinfile = "/mnt/bigass/src/xmms/skindev/winamp29x.zip";
48 public __gshared string skinfile = "!BUILTIN!";
49 public __gshared bool modeShuffle = false;
50 public __gshared bool modeRepeat = false;
51 public __gshared int softVolume = 31; // [0..63]; *100/31 will be volume in percents
52 public __gshared bool eqVisible = false;
53 public __gshared bool plVisible = true;
54 public __gshared bool modeRemaining = false;
55 public __gshared bool plEllipsisAtStart = false;
58 shared static this () {
59 conRegVar!plEllipsisAtStart("pl_ellipsis_at_start", "put ellipsis at start in too long playlist items",
60 delegate (ConVarBase self, bool oldval, bool newval) {
61 if (oldval != newval) glconPostScreenRebuild();
64 conRegVar!modeShuffle("mode_shuffle", "shuffle playlist",
65 delegate (ConVarBase self, bool oldval, bool newval) {
66 if (oldval != newval) glconPostScreenRebuild();
69 conRegVar!modeRepeat("mode_repeat", "repeat playlist",
70 delegate (ConVarBase self, bool oldval, bool newval) {
71 if (oldval != newval) glconPostScreenRebuild();
74 conRegVar!modeRemaining("mode_remaining", "show remaining time in song timer instead of passed",
75 delegate (ConVarBase self, bool oldval, bool newval) {
76 if (oldval != newval) glconPostScreenRebuild();
80 conRegVar!softVolume(0, 63, "soft_volume", "soft volume; 31 is normal",
81 delegate (ConVarBase self, int oldval, int newval) {
82 //conwriteln("volume changed: old=", oldval, "; new=", newval);
83 if (oldval != newval) glconPostScreenRebuild();
84 aplayPlayGain(newval*100/31-100);
87 conRegFunc!((int delta) {
88 int newval = softVolume+delta;
89 if (newval < 0) newval = 0;
90 if (newval > 63) newval = 63;
91 if (newval != softVolume) {
92 softVolume = newval;
93 glconPostScreenRebuild();
94 aplayPlayGain(newval*100/31-100);
96 })("soft_volume_rel", "soft volume, relative");
98 conRegVar!eqVisible("eq_visible", "toggle equalizer",
99 delegate (ConVarBase self, bool oldval, bool newval) {
100 if (oldval != newval) {
101 if (sdeqwin is null || sdeqwin.closed) {
102 if (sdampwin is null || sdampwin.closed) return;
103 if (!newval) return;
104 if (dgCreateEqWindow !is null) dgCreateEqWindow();
105 } else {
106 if (sdeqwin.hidden != !newval) {
107 if (newval) sdeqwin.show(); else sdeqwin.hide();
110 glconPostScreenRebuild();
114 conRegVar!plVisible("pl_visible", "toggle playlist",
115 delegate (ConVarBase self, bool oldval, bool newval) {
116 if (oldval != newval) {
117 if (sdplwin is null || sdplwin.closed) {
118 if (sdampwin is null || sdampwin.closed) return;
119 if (!newval) return;
120 if (dgCreatePListWindow !is null) dgCreatePListWindow();
121 } else {
122 if (sdplwin.hidden != !newval) {
123 if (newval) sdplwin.show(); else sdplwin.hide();
126 glconPostScreenRebuild();