Bug Fixes with Music playing
This commit is contained in:
@@ -27,7 +27,6 @@ public class CommandMusicMain extends Command
|
|||||||
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
{
|
{
|
||||||
SubCommandFormattable scf = framework.run(guild, channel, user, input);
|
SubCommandFormattable scf = framework.run(guild, channel, user, input);
|
||||||
System.out.println("SCF: " + scf.resString);
|
|
||||||
scf.Call(res);
|
scf.Call(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,6 @@ public class SubCommandStop extends SubCommand
|
|||||||
@Override
|
@Override
|
||||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
||||||
{
|
{
|
||||||
|
|
||||||
return new SubCommandFormattable(guild.audio.stopPlayer(guild.audio.player));
|
return new SubCommandFormattable(guild.audio.stopPlayer(guild.audio.player));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,9 +104,9 @@ public class AudioUtils
|
|||||||
{
|
{
|
||||||
playlist.add(track);
|
playlist.add(track);
|
||||||
}
|
}
|
||||||
if(!isPlaying)
|
|
||||||
|
if(player.getPlayingTrack() == null)
|
||||||
{
|
{
|
||||||
isPlaying = true;
|
|
||||||
startPlay(player);
|
startPlay(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,21 +118,31 @@ public class AudioUtils
|
|||||||
guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(player));
|
guild.getAudioManager().setSendingHandler(new AudioPlayerSendHandler(player));
|
||||||
playerManager.loadItemOrdered(player, videoURL, new SmallAudio(player));
|
playerManager.loadItemOrdered(player, videoURL, new SmallAudio(player));
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startPlay(AudioPlayer player)
|
private void startPlay(AudioPlayer player)
|
||||||
{
|
{
|
||||||
|
isPlaying = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if(player.getPlayingTrack() == null)
|
if(player.getPlayingTrack() == null)
|
||||||
{
|
{
|
||||||
player.startTrack(playlist.get(0), false);
|
if(playlist.isEmpty())
|
||||||
if(!playlist.isEmpty())
|
{
|
||||||
playlist.remove(0);
|
isPlaying = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.startTrack(playlist.get(0), false);
|
||||||
|
|
||||||
|
if(!playlist.isEmpty())
|
||||||
|
playlist.remove(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(!playlist.isEmpty());
|
while(isPlaying);
|
||||||
isPlaying = false;
|
isPlaying = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user