-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/Audio Filters #809
base: master
Are you sure you want to change the base?
Conversation
This is still a dirty implementation, i did a bad job of keeping Vctr's code seperate from just the filter commands. This will need some cleanup. I do not think this is ready to merge in the state it is in. |
In before-hand: I'm sure just by scrolling through the diff you can easily spot things to fix, like the commented pom dependencies, the IntelliJ project file (which should be removed), the code that's commented out etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies if I may sound aggressive, offensive or similar in this review. There are too many problems with this pull request. I have doubts that this feature will ever become a thing... not without this being rewritten, at the very least. This pull request seems to be using third party code too, which is something I'm not too fond of. Currently, there is no way to approve this. I'd recommend rewriting this with the master branch (and not in your fork) and not using other people's code. Regardless, here are some of the issues with this pull request:
@@ -2,6 +2,7 @@ | |||
/target/ | |||
/Playlists/ | |||
/test/ | |||
.idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not modify the gitignore
.idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.idea is to be excluded tho.
@@ -0,0 +1,88 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this file
<dependency> | ||
<groupId>com.github.natanbc</groupId> | ||
<artifactId>lavadsp</artifactId> | ||
<version>0.7.5</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not checked, but is this dependency needed?
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib-jdk8</artifactId> | ||
<version>${kotlin.version}</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project does not use Kotlin.
<dependency> | |
<groupId>org.jetbrains.kotlin</groupId> | |
<artifactId>kotlin-stdlib-jdk8</artifactId> | |
<version>${kotlin.version}</version> | |
</dependency> |
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest-core</artifactId> | ||
<version>1.3</version> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-test</artifactId> | ||
<version>${kotlin.version}</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project does not Kotlin. Revert this to the original state.
<groupId>org.hamcrest</groupId> | |
<artifactId>hamcrest-core</artifactId> | |
<version>1.3</version> | |
<groupId>org.jetbrains.kotlin</groupId> | |
<artifactId>kotlin-test</artifactId> | |
<version>${kotlin.version}</version> | |
<groupId>org.hamcrest</groupId> | |
<artifactId>hamcrest-core</artifactId> | |
<version>1.3</version> |
else | ||
{ | ||
nvolume = Math.abs(nvolume); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like it will change anything.
nvolume = Math.abs(nvolume); |
@@ -61,7 +61,8 @@ protected void execute(CommandEvent event) | |||
+ "\nCustom Prefix: " + (s.getPrefix() == null ? "None" : "`" + s.getPrefix() + "`") | |||
+ "\nRepeat Mode: **" + (s.getRepeatMode() ? "On" : "Off") + "**" | |||
+ "\nDefault Playlist: " + (s.getDefaultPlaylist() == null ? "None" : "**" + s.getDefaultPlaylist() + "**") | |||
) | |||
+ "\nForbidden Audio: **" + (s.getForbiddenAudio() ? "On" : "Off") + "**" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this setting.
@@ -61,7 +61,8 @@ protected void execute(CommandEvent event) | |||
+ "\nCustom Prefix: " + (s.getPrefix() == null ? "None" : "`" + s.getPrefix() + "`") | |||
+ "\nRepeat Mode: **" + (s.getRepeatMode() ? "On" : "Off") + "**" | |||
+ "\nDefault Playlist: " + (s.getDefaultPlaylist() == null ? "None" : "**" + s.getDefaultPlaylist() + "**") | |||
) | |||
+ "\nForbidden Audio: **" + (s.getForbiddenAudio() ? "On" : "Off") + "**" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the text bold only if its turned on.
+ "\nForbidden Audio: **" + (s.getForbiddenAudio() ? "On" : "Off") + "**" | |
+ "\nForbidden Audio: " + (s.getForbiddenAudio() ? "**On**" : "Off") |
@@ -0,0 +1,5 @@ | |||
package com.jagrosh.jmusicbot.utils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing license header. This somewhat looks like someone else's code, though.
package com.jagrosh.jmusicbot.utils; | |
/* | |
* Copyright 2021 John Grosh <john.a.grosh@gmail.com>. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
*/ | |
package com.jagrosh.jmusicbot.utils; |
@@ -0,0 +1,115 @@ | |||
package com.jagrosh.jmusicbot.utils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing license header. This looks like someone else's code, though.
package com.jagrosh.jmusicbot.utils; | |
/* | |
* Copyright 2021 John Grosh <john.a.grosh@gmail.com>. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
* See the License for the specific language governing permissions and | |
* limitations under the License. | |
*/ | |
package com.jagrosh.jmusicbot.utils; |
<!-- <dependency>--> | ||
<!-- <groupId>com.jagrosh</groupId>--> | ||
<!-- <artifactId>JagTag</artifactId>--> | ||
<!-- <version>0.5</version>--> | ||
<!-- </dependency>--> | ||
<dependency> | ||
<groupId>com.mashape.unirest</groupId> | ||
<artifactId>unirest-java</artifactId> | ||
<version>1.4.9</version> | ||
<type>jar</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>club.minnced</groupId> | ||
<artifactId>discord-webhooks</artifactId> | ||
<version>0.3.0</version> | ||
</dependency> | ||
<!-- <dependency>--> | ||
<!-- <groupId>de.dfki.mary</groupId>--> | ||
<!-- <artifactId>voice-cmu-slt-hsmm</artifactId>--> | ||
<!-- <version>5.2</version>--> | ||
<!-- </dependency>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented & unused dependencies.
<!-- <dependency>--> | |
<!-- <groupId>com.jagrosh</groupId>--> | |
<!-- <artifactId>JagTag</artifactId>--> | |
<!-- <version>0.5</version>--> | |
<!-- </dependency>--> | |
<dependency> | |
<groupId>com.mashape.unirest</groupId> | |
<artifactId>unirest-java</artifactId> | |
<version>1.4.9</version> | |
<type>jar</type> | |
</dependency> | |
<dependency> | |
<groupId>club.minnced</groupId> | |
<artifactId>discord-webhooks</artifactId> | |
<version>0.3.0</version> | |
</dependency> | |
<!-- <dependency>--> | |
<!-- <groupId>de.dfki.mary</groupId>--> | |
<!-- <artifactId>voice-cmu-slt-hsmm</artifactId>--> | |
<!-- <version>5.2</version>--> | |
<!-- </dependency>--> |
<!-- <dependency>--> | ||
<!-- <groupId>org.hamcrest</groupId>--> | ||
<!-- <artifactId>hamcrest-core</artifactId>--> | ||
<!-- <version>1.3</version>--> | ||
<!-- <scope>test</scope>--> | ||
<!-- </dependency>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented dependency.
<!-- <dependency>--> | |
<!-- <groupId>org.hamcrest</groupId>--> | |
<!-- <artifactId>hamcrest-core</artifactId>--> | |
<!-- <version>1.3</version>--> | |
<!-- <scope>test</scope>--> | |
<!-- </dependency>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this mess?
/** | ||
* Destroy the player and stop playing track. | ||
*/ | ||
public void destroy() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Destructor" in java? U sure u doing this correctly?
for (int i = 0; i < array.length; i++) { | ||
// if (i % 2 == 0 && i % fac2 != 0) | ||
// array[i]=0; | ||
array[i] = array[(i / fac2) * fac2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mathematically this doesn't make any sense to me.
Why not i-1? or i++ next line?
Did you mean array[i] = array[i] / fac2 * fac2
?
|
||
init { | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kotlin, which means splits pom changes are required. I don't see a reason why this code is in kotlin tho.
return String.format("Karaoke") | ||
} | ||
|
||
init { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty init is redundant.
@@ -0,0 +1,46 @@ | |||
/* | |||
* Copyright 2020 natanbc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe Natan is fine with this.
@@ -0,0 +1,5 @@ | |||
package com.jagrosh.jmusicbot.utils; | |||
|
|||
class ScalarFunctions implements VectorSupport.FilterFunctions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this empty class needed? Afaik if you implement an interface you actually have to implement the methods of it.
@@ -0,0 +1,115 @@ | |||
package com.jagrosh.jmusicbot.utils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is written by natanbc from his github repo of lavaplayer filters.
another funny would be a max volume option in the settings |
This pull request...
Description
Adds the
filter
command, with a handful of subcommands.Purpose
Audio Funny
Relevant Issue(s)
N/A