-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
704 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
android/src/main/aidl/tech/soit/quiet/ISessionDataProvider.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// ISessionDataProvider.aidl | ||
package tech.soit.quiet; | ||
|
||
import tech.soit.quiet.player.MusicMetadata; | ||
import tech.soit.quiet.MusicResult; | ||
|
||
parcelable ArtworkData; | ||
|
||
interface ISessionDataProvider { | ||
|
||
ArtworkData loadArtwork(in MusicMetadata metadata); | ||
|
||
String getPlayerUrl(String id, String fallbackUrl); | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package tech.soit.quiet | ||
|
||
import android.os.Parcel | ||
import android.os.Parcelable | ||
|
||
class ArtworkData( | ||
val color: Int?, | ||
val image: ByteArray | ||
) : Parcelable { | ||
|
||
constructor(source: Parcel) : this( | ||
source.readValue(Int::class.java.classLoader) as Int?, | ||
source.createByteArray()!! | ||
) | ||
|
||
override fun describeContents() = 0 | ||
|
||
override fun writeToParcel(dest: Parcel, flags: Int) = with(dest) { | ||
writeValue(color) | ||
writeByteArray(image) | ||
} | ||
|
||
companion object { | ||
@JvmField | ||
val CREATOR: Parcelable.Creator<ArtworkData> = object : Parcelable.Creator<ArtworkData> { | ||
override fun createFromParcel(source: Parcel): ArtworkData = ArtworkData(source) | ||
override fun newArray(size: Int): Array<ArtworkData?> = arrayOfNulls(size) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import 'package:music_player_example/player/player.dart'; | ||
|
||
class AppPlayQueue implements PlayQueue { | ||
final String queueId; | ||
|
||
final List<PlayItem> queue; | ||
|
||
bool get isEmpty => queue.isEmpty; | ||
|
||
const AppPlayQueue({ | ||
required this.queueId, | ||
required this.queue, | ||
}); | ||
|
||
const AppPlayQueue.empty() | ||
: this( | ||
queueId: "empty", | ||
queue: const [], | ||
); | ||
|
||
@override | ||
Future<PlayItem?> getNext(PlayItem? current) async { | ||
if (isEmpty) { | ||
return null; | ||
} | ||
if (current == null) { | ||
return queue.first; | ||
} | ||
final index = queue.indexOf(current); | ||
if (index == -1) { | ||
return null; | ||
} | ||
if (index == queue.length - 1) { | ||
return null; | ||
} | ||
return queue[index + 1]; | ||
} | ||
|
||
@override | ||
Future<PlayItem?> getPrevious(PlayItem? current) async { | ||
if (isEmpty) { | ||
return null; | ||
} | ||
if (current == null) { | ||
return queue.first; | ||
} | ||
final index = queue.indexOf(current); | ||
if (index == -1) { | ||
return null; | ||
} | ||
if (index == 0) { | ||
return null; | ||
} | ||
return queue[index - 1]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
export 'src/channel_ui.dart'; | ||
export "src/model/playback_error.dart"; | ||
export 'src/player/music_metadata.dart'; | ||
export 'src/player/play_mode.dart'; | ||
export 'src/player/play_queue.dart'; | ||
export 'src/player/playback_state.dart'; | ||
export 'src/player/transport_controls.dart'; | ||
export 'src/utils/interceptor.dart'; | ||
export 'src/utils/progress_track_container.dart'; | ||
export 'src/queue.dart'; |
Oops, something went wrong.