Makes some modifications to console output.
This should hopefully make things easier to parse for the end user.
This commit is contained in:
@@ -267,7 +267,7 @@ public class PlayerEnvironment
|
||||
.build();
|
||||
OPTIONS.addOption(play);
|
||||
Option pause = Option.builder().longOpt("pause")
|
||||
.desc("Starts playback.")
|
||||
.desc("Pauses playback.")
|
||||
.build();
|
||||
OPTIONS.addOption(pause);
|
||||
Option toggle = Option.builder("t").longOpt("toggle")
|
||||
@@ -326,7 +326,7 @@ public class PlayerEnvironment
|
||||
{
|
||||
try
|
||||
{
|
||||
out.println(cmd.toString());
|
||||
// out.println(cmd.toString());
|
||||
for (Option op : cmd.getOptions())
|
||||
{
|
||||
switch (op.getLongOpt())
|
||||
@@ -476,18 +476,40 @@ public class PlayerEnvironment
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
Collections.reverse(songs);
|
||||
out.println("Playing " + songs);
|
||||
if (!cmd.hasOption("search"))
|
||||
{
|
||||
if (songs.size() > 0)
|
||||
{
|
||||
out.print("Playing ");
|
||||
}
|
||||
}
|
||||
if (songs.size() > 0)
|
||||
{
|
||||
out.print(songs.get(0));
|
||||
if (songs.size() > 1)
|
||||
{
|
||||
Song song;
|
||||
ListIterator<Song> iter = songs.listIterator(1);
|
||||
while (iter.hasNext())
|
||||
{
|
||||
song = iter.next();
|
||||
if (!cmd.hasOption("search"))
|
||||
{
|
||||
out.print("; ");
|
||||
}
|
||||
else
|
||||
{
|
||||
out.println();
|
||||
}
|
||||
out.print(song.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
out.println();
|
||||
if (!cmd.hasOption("search"))
|
||||
{
|
||||
Queue.getInstance().addAll(songs);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Song song : songs)
|
||||
{
|
||||
out.println(song);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Throwable e)
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
package edu.regis.universeplayer.player;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ForkJoinTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import edu.regis.universeplayer.AbstractTask;
|
||||
import edu.regis.universeplayer.PlaybackListener;
|
||||
import edu.regis.universeplayer.PlaybackStatus;
|
||||
@@ -21,9 +8,15 @@ import edu.regis.universeplayer.browserCommands.QueryFuture;
|
||||
import edu.regis.universeplayer.data.InternetSong;
|
||||
import edu.regis.universeplayer.data.LocalSong;
|
||||
import edu.regis.universeplayer.data.PlaybackEvent;
|
||||
import edu.regis.universeplayer.data.Queue;
|
||||
import edu.regis.universeplayer.data.Song;
|
||||
import edu.regis.universeplayer.gui.Interface;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ForkJoinTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* The PlayerManager serves as the central access point for playing songs of any
|
||||
|
||||
Reference in New Issue
Block a user