Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] mute patch for mp3-0.8.3
Hi list,
i made a little patch for the mp3-0.8.3 plugin, that gives a
configuration option to mute vdr after the end of a play list. This is
useful i think, if you don't want to get annoyed by a tv commercial
after your playlist has ended. The patch can also be downloaded here
(http://www.gohle.org/vdr.htm)
Christoph.
diff -Nur mp3-0.8.3/i18n.c mp3-0.8.3-mutepatch/i18n.c
--- mp3-0.8.3/i18n.c Sat May 24 09:04:29 2003
+++ mp3-0.8.3-mutepatch/i18n.c Sat May 1 18:30:09 2004
@@ -1480,6 +1480,23 @@
"", // TODO
"Limitador del nivell",
},
+ { "Setup.MP3$Mute at playlist end",
+ "Am Spiellistenende stummschalten",
+ "",
+ "", // TODO
+ "", // TODO
+ "", // TODO
+ "",
+ "", // TODO
+ "", // TODO
+ "", // TODO
+ "",
+ "", // TODO
+ "",
+ "", // TODO
+ "", // TODO
+ "",
+ },
// start of MPlayer specific phrases
diff -Nur mp3-0.8.3/menu-mp3.c mp3-0.8.3-mutepatch/menu-mp3.c
--- mp3-0.8.3/menu-mp3.c Sun May 25 17:57:38 2003
+++ mp3-0.8.3-mutepatch/menu-mp3.c Sat May 1 18:26:06 2004
@@ -71,6 +71,7 @@
Add(new cMenuEditStraItem(tr("Setup.MP3$CDDB for CD-Audio"), &data.UseCddb,3,cddb));
Add(new cMenuEditStrItem( tr("Setup.MP3$CDDB server"), data.CddbHost,MAX_HOSTNAME,allowed));
Add(new cMenuEditIntItem( tr("Setup.MP3$CDDB port"), &data.CddbPort,1,65535));
+ Add(new cMenuEditBoolItem( tr("Setup.MP3$Mute at playlist end"), &data.muteAtEoList));
}
void cMenuSetupMP3::Store(void)
@@ -93,6 +94,7 @@
SetupStore("UseCddb", MP3Setup.UseCddb );
SetupStore("CddbHost", MP3Setup.CddbHost );
SetupStore("CddbPort", MP3Setup.CddbPort );
+ SetupStore("MuteAtEol", MP3Setup.muteAtEoList );
}
// --- cMP3Control --------------------------------------------------------
diff -Nur mp3-0.8.3/mp3.c mp3-0.8.3-mutepatch/mp3.c
--- mp3-0.8.3/mp3.c Sun May 25 17:55:56 2003
+++ mp3-0.8.3-mutepatch/mp3.c Sat May 1 12:39:13 2004
@@ -167,7 +167,8 @@
else if (!strcasecmp(Name, "UseCddb")) MP3Setup.UseCddb = atoi(Value);
else if (!strcasecmp(Name, "CddbHost")) strn0cpy(MP3Setup.CddbHost,Value,MAX_HOSTNAME);
else if (!strcasecmp(Name, "CddbPort")) MP3Setup.CddbPort = atoi(Value);
- else return false;
+ else if (!strcasecmp(Name, "MuteAtEol")) MP3Setup.muteAtEoList = atoi(Value);
+else return false;
return true;
}
diff -Nur mp3-0.8.3/player-mp3.c mp3-0.8.3-mutepatch/player-mp3.c
--- mp3-0.8.3/player-mp3.c Sat May 10 13:10:03 2003
+++ mp3-0.8.3-mutepatch/player-mp3.c Sat May 1 14:59:28 2004
@@ -37,6 +37,7 @@
#include <vdr/ringbuffer.h>
#include <vdr/tools.h>
#include <vdr/recording.h>
+#include <vdr/remote.h>
#include "common.h"
#include "setup-mp3.h"
@@ -803,6 +804,9 @@
if(MP3Setup.InitLoopMode) trickmode|=tmLoop;
if(MP3Setup.InitShuffleMode) trickmode|=tmShuffle;
d(printf("mp3: inital trickmode=%d\n",trickmode))
+
+ if(MP3Setup.muteAtEoList && cDevice::PrimaryDevice()->IsMute()) cDevice::PrimaryDevice()->ToggleMute(); // unmute if muted
+
}
cMP3Player::~cMP3Player()
@@ -1082,6 +1086,7 @@
else {
state=msWait;
d(printf("mp3: end of playlist\n"))
+ if (MP3Setup.muteAtEoList && !cDevice::PrimaryDevice()->IsMute()) cRemote::Put(kMute); //Mute after the end of the PlayList
}
// fall through
case msStop:
diff -Nur mp3-0.8.3/setup-mp3.c mp3-0.8.3-mutepatch/setup-mp3.c
--- mp3-0.8.3/setup-mp3.c Mon Dec 16 20:51:59 2002
+++ mp3-0.8.3-mutepatch/setup-mp3.c Sat May 1 12:37:38 2004
@@ -47,4 +47,5 @@
UseCddb = 1;
strcpy(CddbHost,"freedb.freedb.org");
CddbPort = 888;
+ muteAtEoList = false;
}
diff -Nur mp3-0.8.3/setup-mp3.h mp3-0.8.3-mutepatch/setup-mp3.h
--- mp3-0.8.3/setup-mp3.h Thu Dec 12 19:43:43 2002
+++ mp3-0.8.3-mutepatch/setup-mp3.h Sat May 1 12:45:16 2004
@@ -53,6 +53,7 @@
int UseCddb;
char CddbHost[MAX_HOSTNAME];
int CddbPort;
+ int muteAtEoList;
public:
cMP3Setup(void);
};
Home |
Main Index |
Thread Index