forked from batocera-linux/batocera.linux
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from andriniaina/mpv
Add MPV media player
- Loading branch information
Showing
7 changed files
with
174 additions
and
0 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
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,80 @@ | ||
{ | ||
"actions_player1": [ | ||
{ | ||
"trigger": "up", | ||
"type": "key", | ||
"target": "KEY_UP" | ||
}, | ||
{ | ||
"trigger": "down", | ||
"type": "key", | ||
"target": "KEY_DOWN" | ||
}, | ||
{ | ||
"trigger": "left", | ||
"type": "key", | ||
"target": "KEY_LEFT" | ||
}, | ||
{ | ||
"trigger": "right", | ||
"type": "key", | ||
"target": "KEY_RIGHT" | ||
}, | ||
{ | ||
"trigger": "select", | ||
"type": "key", | ||
"target": "KEY_ESC" | ||
}, | ||
{ | ||
"trigger": "a", | ||
"type": "key", | ||
"target": "KEY_SPACE" | ||
}, | ||
{ | ||
"trigger": [ | ||
"hotkey", | ||
"start" | ||
], | ||
"type": "key", | ||
"target": "KEY_Q" | ||
}, | ||
{ | ||
"trigger": "b", | ||
"type": "key", | ||
"target": "KEY_O" | ||
}, | ||
{ | ||
"trigger": "joystick1", | ||
"type": "mouse" | ||
}, | ||
{ | ||
"trigger": "joystick2", | ||
"type": "mouse" | ||
}, | ||
{ | ||
"trigger": "pagedown", | ||
"type": "key", | ||
"target": "KEY_PAGEUP" | ||
}, | ||
{ | ||
"trigger": "pageup", | ||
"type": "key", | ||
"target": "KEY_PAGEDOWN" | ||
}, | ||
{ | ||
"trigger": "l1", | ||
"type": "key", | ||
"target": ["KEY_LEFTSHIFT", "KEY_PAGEUP"] | ||
}, | ||
{ | ||
"trigger": "l2", | ||
"type": "key", | ||
"target": ["KEY_LEFTSHIFT", "KEY_PAGEDOWN"] | ||
}, | ||
{ | ||
"trigger": "x", | ||
"type": "key", | ||
"target": "KEY_J" | ||
} | ||
] | ||
} |
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
1 change: 1 addition & 0 deletions
1
package/batocera/core/batocera-configgen/configgen/configgen/generators/mpv/__init__.py
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 @@ | ||
|
29 changes: 29 additions & 0 deletions
29
package/batocera/core/batocera-configgen/configgen/configgen/generators/mpv/mpvGenerator.py
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,29 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
from typing import TYPE_CHECKING | ||
|
||
from ... import Command | ||
from ...controller import generate_sdl_game_controller_config, write_sdl_controller_db | ||
from ..Generator import Generator | ||
|
||
if TYPE_CHECKING: | ||
from ...types import HotkeysContext | ||
|
||
|
||
class MpvGenerator(Generator): | ||
|
||
def getHotkeysContext(self) -> HotkeysContext: | ||
return { | ||
"name": "shell", | ||
"keys": { "exit": ["KEY_LEFTSHIFT", "KEY_Q"] } | ||
} | ||
|
||
def generate(self, system, rom, playersControllers, metadata, guns, wheels, gameResolution): | ||
rom_path = Path(rom) | ||
|
||
commandArray = [system.config["emulator"], rom_path, "--fs"] | ||
return Command.Command(array=commandArray) | ||
|
||
def getMouseMode(self, config, rom): | ||
return True |
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