Skip to content

Commit

Permalink
Removed more long deprecated stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
koca2000 committed Jul 6, 2021
1 parent 852d0a7 commit 505c3bb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 384 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/xxmicloxx/NoteBlockAPI/model/Note.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* Represents a note played; contains the instrument and the key
* @see NotePitch
*
*/
public class Note {
Expand Down
60 changes: 0 additions & 60 deletions src/main/java/com/xxmicloxx/NoteBlockAPI/model/NotePitch.java

This file was deleted.

90 changes: 0 additions & 90 deletions src/main/java/com/xxmicloxx/NoteBlockAPI/model/Song.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,96 +35,6 @@ public Song(Song other) {
other.getDescription(), other.getPath(), other.getFirstCustomInstrumentIndex(), other.getCustomInstruments(), other.isStereo);
}

/**
* @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, boolean)}
* @param speed
* @param layerHashMap
* @param songHeight
* @param length
* @param title
* @param author
* @param description
* @param path
*/
@Deprecated
public Song(float speed, HashMap<Integer, Layer> layerHashMap,
short songHeight, final short length, String title, String author,
String description, File path) {
this(speed, layerHashMap, songHeight, length, title, author, description, path, InstrumentUtils.getCustomInstrumentFirstIndex(), new CustomInstrument[0], false);
}

/**
* @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, CustomInstrument[], boolean)}
* @param speed
* @param layerHashMap
* @param songHeight
* @param length
* @param title
* @param author
* @param description
* @param path
* @param customInstruments
*/
@Deprecated
public Song(float speed, HashMap<Integer, Layer> layerHashMap,
short songHeight, final short length, String title, String author,
String description, File path, CustomInstrument[] customInstruments) {
this(speed, layerHashMap, songHeight, length, title, author, description, path, InstrumentUtils.getCustomInstrumentFirstIndex(), customInstruments, false);
}

/**
* @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, boolean)}
* @param speed
* @param layerHashMap
* @param songHeight
* @param length
* @param title
* @param author
* @param description
* @param path
* @param firstCustomInstrumentIndex
*/
@Deprecated
public Song(float speed, HashMap<Integer, Layer> layerHashMap,
short songHeight, final short length, String title, String author,
String description, File path, int firstCustomInstrumentIndex) {
this(speed, layerHashMap, songHeight, length, title, author, description, path, firstCustomInstrumentIndex, new CustomInstrument[0], false);
}

/**
* @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, CustomInstrument[], boolean)}
* @param speed
* @param layerHashMap
* @param songHeight
* @param length
* @param title
* @param author
* @param description
* @param path
* @param firstCustomInstrumentIndex
* @param customInstruments
*/
@Deprecated
public Song(float speed, HashMap<Integer, Layer> layerHashMap,
short songHeight, final short length, String title, String author,
String description, File path, int firstCustomInstrumentIndex, CustomInstrument[] customInstruments) {
this(speed, layerHashMap, songHeight, length, title, author, description, path, firstCustomInstrumentIndex, customInstruments, false);
}

@Deprecated
public Song(float speed, HashMap<Integer, Layer> layerHashMap,
short songHeight, final short length, String title, String author,
String description, File path, int firstCustomInstrumentIndex, boolean isStereo) {
this(speed, layerHashMap, songHeight, length, title, author, "", description, path, firstCustomInstrumentIndex, new CustomInstrument[0], isStereo);
}

@Deprecated
public Song(float speed, HashMap<Integer, Layer> layerHashMap,
short songHeight, final short length, String title, String author,
String description, File path, int firstCustomInstrumentIndex, CustomInstrument[] customInstruments, boolean isStereo) {
this(speed, layerHashMap, songHeight, length, title, author, "", description, path, firstCustomInstrumentIndex, customInstruments, isStereo);
}

public Song(float speed, HashMap<Integer, Layer> layerHashMap,
short songHeight, final short length, String title, String author, String originalAuthor,
String description, File path, int firstCustomInstrumentIndex, boolean isStereo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,6 @@ public void playTick(Player player, int tick) {
}
}

/**
* Returns if the SongPlayer will play Notes from two sources as stereo
* @return if is played stereo
* @deprecated
*/
@Deprecated
public boolean isStereo(){
return !(channelMode instanceof MonoMode);
}

/**
* Sets if the SongPlayer will play Notes from two sources as stereo
* @param stereo
* @deprecated
*/
@Deprecated
public void setStereo(boolean stereo){
channelMode = stereo ? new MonoMode() : new MonoStereoMode();
}

/**
* Sets how will be {@link Note} played to {@link Player} (eg. mono or stereo). Default is {@link MonoMode}.
* @param mode
Expand Down
145 changes: 12 additions & 133 deletions src/main/java/com/xxmicloxx/NoteBlockAPI/songplayer/SongPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,35 @@
*
*/
public abstract class SongPlayer {
protected NoteBlockAPI plugin;

protected Song song;
protected Playlist playlist;
protected int actualSong = 0;

protected boolean playing = false;
protected boolean fading = false;
protected short tick = -1;
protected Map<UUID, Boolean> playerList = new ConcurrentHashMap<UUID, Boolean>();

protected boolean autoDestroy = false;
protected boolean playing = false;
protected boolean fading = false;
protected boolean destroyed = false;

protected Map<UUID, Boolean> playerList = new ConcurrentHashMap<UUID, Boolean>();
protected Map<Song, Boolean> songQueue = new ConcurrentHashMap<Song, Boolean>(); //True if already played

protected byte volume = 100;
protected Fade fadeIn;
protected Fade fadeOut;
protected Fade fadeTemp = null;
protected SoundCategory soundCategory;
protected RepeatMode repeat = RepeatMode.NO;
protected ChannelMode channelMode = new MonoMode();
protected boolean random = false;

protected Map<Song, Boolean> songQueue = new ConcurrentHashMap<Song, Boolean>(); //True if already played
protected boolean enable10Octave = false;
protected boolean autoDestroy = false;

private final Lock lock = new ReentrantLock();
private final Random rng = new Random();

protected NoteBlockAPI plugin;

protected SoundCategory soundCategory;
protected ChannelMode channelMode = new MonoMode();
protected boolean enable10Octave = false;

public SongPlayer(Song song) {
this(new Playlist(song), SoundCategory.MASTER);
}
Expand Down Expand Up @@ -95,107 +93,6 @@ public SongPlayer(Playlist playlist, SoundCategory soundCategory, boolean random

start();
}

/**
* Gets the FadeType for this SongPlayer (unused)
* @return FadeType
* @deprecated returns fadeIn value
*/
@Deprecated
public FadeType getFadeType() {
return fadeIn.getType();
}

/**
* Sets the FadeType for this SongPlayer
* @param fadeType
* @deprecated set fadeIn value
*/
@Deprecated
public void setFadeType(FadeType fadeType) {
fadeIn.setType(fadeType);
}

/**
* Target volume for fade
* @return byte representing fade target
* @deprecated returns fadeIn value
*/
@Deprecated
public byte getFadeTarget() {
return fadeIn.getFadeTarget();
}

/**
* Set target volume for fade
* @param fadeTarget
* @deprecated set fadeIn value
*/
@Deprecated
public void setFadeTarget(byte fadeTarget) {
fadeIn.setFadeTarget(fadeTarget);
}

/**
* Gets the starting volume for the fade
* @return
* @deprecated returns fadeIn value
*/
@Deprecated
public byte getFadeStart() {
return fadeIn.getFadeStart();
}

/**
* Sets the starting volume for the fade
* @param fadeStart
* @deprecated set fadeIn value
*/
@Deprecated
public void setFadeStart(byte fadeStart) {
fadeIn.setFadeStart(fadeStart);
}

/**
* Gets the duration of the fade
* @return duration of the fade
* @deprecated returns fadeIn value
*/
@Deprecated
public int getFadeDuration() {
return fadeIn.getFadeDuration();
}

/**
* Sets the duration of the fade
* @param fadeDuration
* @deprecated set fadeIn value
*/
@Deprecated
public void setFadeDuration(int fadeDuration) {
fadeIn.setFadeDuration(fadeDuration);
}

/**
* Gets the tick when fade will be finished
* @return tick
* @deprecated returns fadeIn value
*/
@Deprecated
public int getFadeDone() {
return fadeIn.getFadeDone();
}

/**
* Sets the tick when fade will be finished
*
* @param fadeDone
* @deprecated set fadeIn value
*/
@Deprecated
public void setFadeDone(int fadeDone) {
fadeIn.setFadeDone(fadeDone);
}

/**
* Check if 6 octave range is enabled
Expand All @@ -207,8 +104,8 @@ public boolean isEnable10Octave() {
}

/**
* Enable or disable 6 octave range
* <p>
* Enable or disable 10 octave range
*
* If not enabled, notes will be transposed to 2 octave range
*
* @param enable10Octave true if enabled, false otherwise
Expand Down Expand Up @@ -694,24 +591,6 @@ public SoundCategory getCategory() {
public void setCategory(SoundCategory soundCategory) {
this.soundCategory = soundCategory;
}

/**
* Sets whether the SongPlayer will loop
* @deprecated
* @param loop
*/
public void setLoop(boolean loop){
this.repeat = RepeatMode.ALL;
}

/**
* Gets whether the SongPlayer will loop
* @deprecated
* @return is loop
*/
public boolean isLoop(){
return repeat == RepeatMode.ALL;
}

/**
* Sets SongPlayer's {@link RepeatMode}
Expand Down
Loading

0 comments on commit 505c3bb

Please sign in to comment.