mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 23:13:36 +00:00
Preparation to music streaming
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.cappielloantonio.play.model;
|
||||
|
||||
public class DirectPlayCodec {
|
||||
public Codec codec;
|
||||
public boolean selected;
|
||||
|
||||
public DirectPlayCodec(Codec codec, boolean selected) {
|
||||
this.codec = codec;
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
public enum Codec {
|
||||
FLAC("FLAC", "FLAC", "flac|flac"),
|
||||
MP3("MP3", "MP3", "mp3|mp3"),
|
||||
OPUS("Opus", "Opus", "opus|opus"),
|
||||
AAC("M4A", "AAC", "m4a|aac"),
|
||||
VORBIS("OGG", "Vorbis", "ogg|vorbis"),
|
||||
OGG("OGG", "Opus", "ogg|opus"),
|
||||
MKA("MKA", "Opus", "mka|opus");
|
||||
|
||||
public final String container;
|
||||
public final String codec;
|
||||
public final String value;
|
||||
|
||||
Codec(String container, String codec, String value) {
|
||||
this.container = container;
|
||||
this.codec = codec;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,35 +3,21 @@ package com.cappielloantonio.play.model;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(tableName = "queue")
|
||||
public class Queue {
|
||||
@NonNull
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@PrimaryKey
|
||||
@ColumnInfo(name = "id")
|
||||
private int id;
|
||||
|
||||
@ColumnInfo(name = "song_id")
|
||||
private String songID;
|
||||
|
||||
public Queue(@NonNull int id, String songID) {
|
||||
this.id = id;
|
||||
@ColumnInfo(name = "last_played")
|
||||
private long lastPlayed;
|
||||
|
||||
public Queue(String songID, long lastPlayed) {
|
||||
this.songID = songID;
|
||||
}
|
||||
|
||||
@Ignore
|
||||
public Queue(String songID) {
|
||||
this.songID = songID;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
this.lastPlayed = lastPlayed;
|
||||
}
|
||||
|
||||
public String getSongID() {
|
||||
@@ -41,4 +27,12 @@ public class Queue {
|
||||
public void setSongID(String songID) {
|
||||
this.songID = songID;
|
||||
}
|
||||
|
||||
public long getLastPlayed() {
|
||||
return lastPlayed;
|
||||
}
|
||||
|
||||
public void setLastPlayed(long lastPlayed) {
|
||||
this.lastPlayed = lastPlayed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user