Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Added an experimental audio feedback system. This is the first element of a new 'decoration' component which may hold switches for different external appearance parameters. The first switch in that context is decoration.audio (as usual in yacy.init). This value is set to false by default, that means the audio feedback element is switched off by default. To switch it on, set decoration.audio = true (using /ConfigProperties_p.html). You will then hear sounds for the following events: - remote searches - incoming dht transmissions - new documents from the crawler Sound clips are stored in htroot/env/soundclips/ which is done so because a future implementation will read these files using the http client and with configurable urls which will make it very easy for the user to replace the given sounds with own sounds.
Michael Peter Christen2a052f446adf
diff --git a/defaults/yacy.init b/defaults/yacy.initindex d227705b1..093cdad0e 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -1257,3 +1257,6 @@ crawler.userAgent.name = yacybotcrawler.userAgent.string = yacybot ($$SYSTEM$$) http://yacy.net/bot.htmlcrawler.userAgent.minimumdelta = 500crawler.userAgent.clienttimeout = 10000++# interface decorations+decoration.audio = falsediff --git a/htroot/env/soundclips/atmocrawling.wav b/htroot/env/soundclips/atmocrawling.wavnew file mode 100644index 000000000..9b27454d3Binary files /dev/null and b/htroot/env/soundclips/atmocrawling.wav differdiff --git a/htroot/env/soundclips/atmomonitor.wav b/htroot/env/soundclips/atmomonitor.wavnew file mode 100644index 000000000..2d4d82a05Binary files /dev/null and b/htroot/env/soundclips/atmomonitor.wav differdiff --git a/htroot/env/soundclips/dhtin.wav b/htroot/env/soundclips/dhtin.wavnew file mode 100644index 000000000..a1209aef1Binary files /dev/null and b/htroot/env/soundclips/dhtin.wav differdiff --git a/htroot/env/soundclips/newdoc.wav b/htroot/env/soundclips/newdoc.wavnew file mode 100644index 000000000..7b228e75fBinary files /dev/null and b/htroot/env/soundclips/newdoc.wav differdiff --git a/htroot/env/soundclips/remotesearch.wav b/htroot/env/soundclips/remotesearch.wavnew file mode 100644index 000000000..dd149f3baBinary files /dev/null and b/htroot/env/soundclips/remotesearch.wav differdiff --git a/htroot/env/soundclips/sources.txt b/htroot/env/soundclips/sources.txtnew file mode 100644index 000000000..c0d4456c1--- /dev/null+++ b/htroot/env/soundclips/sources.txt@@ -0,0 +1,22 @@+The following sounds had been taken from https://www.freesound.org and renamed from their original name.+Please see license, author and original download page below:++atmocrawling.wav+(CC BY 3.0) by cydon, https://www.freesound.org/people/cydon/+https://www.freesound.org/people/cydon/sounds/126178/++atmomonitor.wav+(CC0) by Diboz, https://www.freesound.org/people/Diboz/+https://www.freesound.org/people/Diboz/sounds/211683/++dhtin.wav (converted from mp3)+(CC0) by Kastenfrosch, https://www.freesound.org/people/Kastenfrosch/+https://www.freesound.org/people/Kastenfrosch/sounds/113986/++newdoc.wav+(CC0) by waterboy920, https://www.freesound.org/people/waterboy920/+https://www.freesound.org/people/waterboy920/sounds/191012/++remotesearch.wav+(CC0) by GameAudio, https://www.freesound.org/people/GameAudio/+https://www.freesound.org/people/GameAudio/sounds/220173/diff --git a/htroot/yacy/search.java b/htroot/yacy/search.javaindex 984eaf9db..ab12cfbdd 100644--- a/htroot/yacy/search.java+++ b/htroot/yacy/search.java@@ -51,6 +51,7 @@ import net.yacy.cora.sorting.WeakPriorityBlockingQueue;import net.yacy.cora.storage.HandleSet;import net.yacy.cora.util.ByteBuffer;import net.yacy.cora.util.SpaceExceededException;+import net.yacy.gui.Audio;import net.yacy.kelondro.data.word.WordReference;import net.yacy.kelondro.data.word.WordReferenceFactory;import net.yacy.kelondro.data.word.WordReferenceRow;@@ -322,7 +323,8 @@ public final class search {);Network.log.info("INIT HASH SEARCH (query-" + abstracts + "): " + QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()) + " - " + theQuery.itemsPerPage() + " links");EventChannel.channels(EventChannel.REMOTESEARCH).addMessage(new RSSMessage("Remote Search Request from " + ((remoteSeed == null) ? "unknown" : remoteSeed.getName()), QueryParams.anonymizedQueryHashes(theQuery.getQueryGoal().getIncludeHashes()), ""));-+ if (sb.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.remotesearch.play();+// make eventtheSearch = SearchEventCache.getEvent(theQuery, sb.peers, sb.tables, null, abstracts.length() > 0, sb.loader, count, maxtime);if (theSearch.rwiProcess != null && theSearch.rwiProcess.isAlive()) try {theSearch.rwiProcess.join();} catch (final InterruptedException e) {}diff --git a/htroot/yacy/transferURL.java b/htroot/yacy/transferURL.javaindex 49c315835..0c2ae58d2 100644--- a/htroot/yacy/transferURL.java+++ b/htroot/yacy/transferURL.java@@ -30,6 +30,7 @@ import java.io.IOException;import java.text.ParseException;import java.util.HashMap;import java.util.Map;+import net.yacy.cora.date.GenericFormatter;import net.yacy.cora.document.encoding.ASCII;import net.yacy.cora.document.feed.RSSMessage;@@ -37,6 +38,7 @@ import net.yacy.cora.protocol.RequestHeader;import net.yacy.cora.util.ConcurrentLog;import net.yacy.crawler.data.ResultURLs;import net.yacy.crawler.data.ResultURLs.EventOrigin;+import net.yacy.gui.Audio;import net.yacy.kelondro.data.meta.URIMetadataNode;import net.yacy.peers.EventChannel;import net.yacy.peers.Network;@@ -174,6 +176,8 @@ public final class transferURL {// return rewrite propertiesNetwork.log.info("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, blocked " + blocked + " URLs");EventChannel.channels(EventChannel.DHTRECEIVE).addMessage(new RSSMessage("Received " + received + ", blocked " + blocked + " URLs from peer " + otherPeerName, "", otherPeer.hash));+ if (sb.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.dhtin.play();+if (doublecheck > 0) {Network.log.warn("Received " + doublecheck + "/" + urlc + " double URLs from peer " + otherPeerName); // double should not happen because we demanded only documents which we do not have yetdoublevalues = Integer.toString(doublecheck);diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.javaindex c809727c6..ddab1acb7 100644--- a/source/net/yacy/search/Switchboard.java+++ b/source/net/yacy/search/Switchboard.java@@ -154,6 +154,7 @@ import net.yacy.document.importer.OAIListFriendsLoader;import net.yacy.document.parser.audioTagParser;import net.yacy.document.parser.pdfParser;import net.yacy.document.parser.html.Evaluation;+import net.yacy.gui.Audio;import net.yacy.gui.Tray;import net.yacy.kelondro.blob.BEncodedHeap;import net.yacy.kelondro.blob.Tables;@@ -2847,7 +2848,8 @@ public final class Switchboard extends serverSwitch {? EventChannel.LOCALINDEXING: EventChannel.REMOTEINDEXING);feed.addMessage(new RSSMessage("Indexed web page", dc_title, queueEntry.url(), ASCII.String(queueEntry.url().hash())));-+ if (this.getConfigBool(SwitchboardConstants.DECORATION_AUDIO, false)) Audio.Soundclip.newdoc.play();+// store rss feeds in document into rss tablefor ( final Map.Entry<DigestURL, String> rssEntry : document.getRSS().entrySet() ) {final Tables.Data rssRow = new Tables.Data();diff --git a/source/net/yacy/search/SwitchboardConstants.java b/source/net/yacy/search/SwitchboardConstants.javaindex d5ee6b25e..d53e6d92c 100644--- a/source/net/yacy/search/SwitchboardConstants.java+++ b/source/net/yacy/search/SwitchboardConstants.java@@ -554,4 +554,10 @@ public final class SwitchboardConstants {* Skins*/public static final String SKINS_PATH_DEFAULT = "DATA/SKINS";++ /*+ * decorations+ */+ public static final String DECORATION_AUDIO = "decoration.audio";+}