Skip to content

Commit

Permalink
Add missing toString methods in various jukebox related classes
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias <webmaster@pottgames.de>
  • Loading branch information
Hangman committed Sep 4, 2023
1 parent 8d2fd78 commit 9f79832
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,10 @@ public boolean hasNext() {
return this.lists.size > 0;
}


@Override
public String toString() {
return "CircularPlayListProvider [lists=" + this.lists + ", index=" + this.index + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,10 @@ public boolean hasNext() {
return this.lists.size > 0;
}


@Override
public String toString() {
return "DefaultPlayListProvider [lists=" + this.lists + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,11 @@ public boolean isLoop() {
return this.loop;
}


@Override
public String toString() {
return "PlayList [songs=" + this.songs + ", songIndex=" + this.songIndex + ", playedThrough=" + this.playedThrough + ", loop=" + this.loop
+ ", shuffleAfterPlaytrough=" + this.shuffleAfterPlaytrough + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,10 @@ public boolean hasNext() {
return list != null;
}


@Override
public String toString() {
return "ThemePlayListProvider [lists=" + this.lists + ", theme=" + this.theme + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,10 @@ public SongMeta getMeta() {
return this.metaData;
}


@Override
public String toString() {
return "Song [source=" + this.source + ", settings=" + this.settings + ", metaData=" + this.metaData + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,10 @@ public Object getAttribute(Object key) {
return this.attributes.get(key);
}


@Override
public String toString() {
return "SongMeta [artist=" + this.artist + ", title=" + this.title + ", album=" + this.album + ", attributes=" + this.attributes + "]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package de.pottgames.tuningfork.jukebox.song;

import java.util.Objects;

import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.MathUtils;

Expand Down Expand Up @@ -177,4 +179,36 @@ public float apply(float a) {

}


@Override
public int hashCode() {
return Objects.hash(this.fadeInCurve, this.fadeInDuration, this.fadeOutCurve, this.fadeOutDuration, this.volume);
}


@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (this.getClass() != obj.getClass()) {
return false;
}
final SongSettings other = (SongSettings) obj;
return Objects.equals(this.fadeInCurve, other.fadeInCurve) && Float.floatToIntBits(this.fadeInDuration) == Float.floatToIntBits(other.fadeInDuration)
&& Objects.equals(this.fadeOutCurve, other.fadeOutCurve)
&& Float.floatToIntBits(this.fadeOutDuration) == Float.floatToIntBits(other.fadeOutDuration)
&& Float.floatToIntBits(this.volume) == Float.floatToIntBits(other.volume);
}


@Override
public String toString() {
return "SongSettings [fadeInDuration=" + this.fadeInDuration + ", fadeOutDuration=" + this.fadeOutDuration + ", fadeInCurve=" + this.fadeInCurve
+ ", fadeOutCurve=" + this.fadeOutCurve + ", volume=" + this.volume + "]";
}

}

0 comments on commit 9f79832

Please sign in to comment.