Beispiel #1
0
def doExit(ev, *args):
    hplayer.playlist.play(
        hplayer.files.selectDir(2) + '/' + HPlayer2.name() + '*')
Beispiel #2
0
from core.engine.hplayer import HPlayer2
from core.engine import network

import os, sys, types, platform
import json


# INIT HPLAYER
hplayer = HPlayer2(
        basepath=['/data/usb', '/data/media'], 
        settingspath="/data/hplayer2.cfg")

# PLAYERS
player = hplayer.addPlayer('mpv', 'player')

# INTERFACES
# hplayer.addInterface('keyboard')
hplayer.addInterface('osc', 4000, 4001)
hplayer.addInterface('http2', 8080)

# RUN
hplayer.run()                               						# TODO: non blocking

Beispiel #3
0
def doPlay(ev, *data):
    print(data)
    s = data[0]
    hplayer.playlist.play(
        hplayer.files.selectDir(s) + '/' + HPlayer2.name() + '*')
Beispiel #4
0
from core.engine.hplayer import HPlayer2
from core.engine import network

import os, sys, types, platform

# DIRECTORY / FILE
profilename = os.path.basename(__file__).split('.')[0]
base_path = ['/data/sync/' + profilename, '/data/usb']

# INIT HPLAYER
hplayer = HPlayer2(base_path, "/data/hplayer2-" + profilename + ".cfg")

# PLAYERS
player = hplayer.addPlayer('mpv', 'mpv')
# midi 	= hplayer.addPlayer('midi','midi')

# Interfaces
hplayer.addInterface('zyre')
hplayer.addInterface('http2', 8080)
# hplayer.addInterface('http', 8037)
# hplayer.addInterface('keyboard')
hplayer.addInterface('teleco')

# MASTER / SLAVE sequencer
iamLeader = False


# Broadcast Order on OSC/Zyre to other Pi's
#
def broadcast(path, *args):
    print(path, list(args))
Beispiel #5
0
from core.engine.hplayer import HPlayer2

tabHold = False
memDirectory = 0

# INIT HPLAYER
hplayer = HPlayer2('/data/sync')

# INTERFACES
hplayer.addInterface('keyboard')
hplayer.addInterface('mqtt', '10.0.0.1')


@hplayer.on('keyboard.*')
def keyboard2MQTT(ev, *args):
    ev = ev.split('.')[-1]

    # tab hold
    if ev.startswith('KEY_TAB'):
        global tabHold
        tabHold = not (ev == 'KEY_TAB-up')

    # mem / dir
    elif ev[6].isnumeric() and ev[8:] == 'down':
        global memDirectory
        if tabHold:
            memDirectory = int(ev[6]) * 10
        else:
            hplayer.interface('mqtt').send('k32/all/leds/mem',
                                           str(memDirectory + int(ev[6])))
Beispiel #6
0
from core.engine.hplayer import HPlayer2
from core.engine import network

import os, sys, types, platform

profilename = os.path.basename(__file__).split('.')[0]

# DIRECTORY / FILE
if HPlayer2.isRPi(): base_path = '/data/sync/xpa'
else: base_path = '/home/mgr/Videos'

# INIT HPLAYER
hplayer = HPlayer2(base_path, "/data/hplayer2-"+profilename+".cfg")

# PLAYERS
player 	= hplayer.addPlayer('mpv','mpv')
midi 	= hplayer.addPlayer('midi','midi')

# Interfaces
hplayer.addInterface('zyre', 'wlan0')
hplayer.addInterface('http2', 8080)
# hplayer.addInterface('http', 8037)
hplayer.addInterface('keyboard')

if HPlayer2.isRPi():
	hplayer.addInterface('keypad')
	hplayer.addInterface('gpio', [21], 310)



Beispiel #7
0
import os, sys, types, platform
import json


# DIRECTORY / FILE
profilename = os.path.basename(__file__).split('.')[0]
projectfolder = os.path.join('/data/sync', profilename)

devicename = network.get_hostname()
devicefolder = os.path.join('/data/sync/solo', devicename)

base_path = ['/data/usb', projectfolder, devicefolder]


# INIT HPLAYER
hplayer = HPlayer2(base_path)


# PLAYERS
video = hplayer.addPlayer('mpv', 'video')
# audio = hplayer.addPlayer('mpv', 'audio')

# ATTACHED ESP 
myESP = 0
try:
    with open(os.path.join(projectfolder, 'esp.json')) as json_file:
        data = json.load(json_file)
        if devicename in data:
            myESP = data[devicename]
            hplayer.log('attached to ESP', myESP)
except: pass