Beispiel #1
0
def setupApps():
    # some apps will require startup methods to init certain things
    SpotifyControl.setup()
    WindowsVolumeMixerControl.updateDevices()
    WindowsProgramControl.setup()
    LaunchApplication.setup()
    Twitch.setup()
Beispiel #2
0
def skipToNextItem(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.shift)
    keyboard.press(Key.right)
    keyboard.release(Key.shift)
    keyboard.release(Key.right)
    keyboard.press(Key.shift)
    keyboard.press("n")
    keyboard.release(Key.shift)
    keyboard.release("n")
Beispiel #3
0
def getCurrentlyPlaying():
    global sp
    global cached_currently_playing
    global deviceIDs
    cached_currently_playing = sp.currently_playing()
    try:
        while cached_currently_playing == None:
            if len(deviceIDs) == 0:
                WindowsProgramControl.openProgram(
                    "Spotify.exe")  # takes a looong time to open
                while deviceIDs == None or len(deviceIDs) == 0:
                    deviceIDs = getDeviceIds()
                WindowsProgramControl.minimizeProgByName("Spotify")
                sp.transfer_playback(deviceIDs[0])
                sp.pause_playback(device_id=deviceIDs[0])
            cached_currently_playing = sp.currently_playing()
        cached_currently_playing['volume'] = getVolume(
        )  # appends volume also (it's not included in the original data)
        return cached_currently_playing
    except Exception as e:
        print(e)
        return None
Beispiel #4
0
def pressNum7(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "7"
    keyboard.press(key)
    keyboard.release(key)
Beispiel #5
0
def Fullscreen(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "f" 
    keyboard.press(key)
    keyboard.release(key)
Beispiel #6
0
def pressDownArrow(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.down)
    keyboard.release(Key.down)
Beispiel #7
0
def pressRightArrow(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.right)
    keyboard.release(Key.right)
Beispiel #8
0
def miniplayer(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "i" 
    keyboard.press(key)
    keyboard.release(key)
Beispiel #9
0
def pressESC(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.esc)
    keyboard.release(Key.esc)
Beispiel #10
0
def theaterMode(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "t" 
    keyboard.press(key)
    keyboard.release(key)
Beispiel #11
0
def mute(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "m" 
    keyboard.press(key)
    keyboard.release(key)
Beispiel #12
0
def closePlayer(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "x" 
    keyboard.press(key)
    keyboard.release(key)
Beispiel #13
0
def pressSpacebar(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.space)
    keyboard.release(Key.space)