Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ProjectAnni/mpris_service

D-Bus MPRIS controls for Linux.
https://github.com/ProjectAnni/mpris_service

Last synced: 3 months ago
JSON representation

D-Bus MPRIS controls for Linux.

Awesome Lists containing this project

README

        

# anni_mpris_service

D-Bus MPRIS controls for Linux.

## Example

```dart
class MyMPRISService extends MPRISService {
MyMPRISService()
: super(
"identifier_string",
identity: "Application Name",
emitSeekedSignal: true,
canPlay: true,
canPause: true,
canGoPrevious: true,
canGoNext: true,
canSeek: true,
supportLoopStatus: true,
supportShuffle: true,
);

@override
Future onPlayPause() async {
print("onPlayPause");
}

@override
Future onPlay() async {
print("onPlay");
await player.play();
}

@override
Future onPause() async {
print("onPause");
}

@override
Future onPrevious() async {
print("onPrevious");
}

@override
Future onNext() async {
print("onNext");
}

@override
Future onSeek(int offset) async {
print("onSeek");
}

@override
Future onSetPosition(String trackId, int position) async {
print("onSetPosition");
}

@override
Future onLoopStatus(LoopStatus loopStatus) async {
print("onLoopStatus");
this.loopStatus = loopStatus;
}

@override
Future onShuffle(bool shuffle) async {
print("onShuffle");
this.shuffle = shuffle;
}
}
```

## License

Licensed under either of

- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE) or )
- MIT license ([LICENSE-MIT](LICENSE-MIT) or )

at your option.