예제 #1
0
def setupApps():
    # some apps will require startup methods to init certain things
    SpotifyControl.setup()
    WindowsVolumeMixerControl.updateDevices()
    WindowsProgramControl.setup()
    LaunchApplication.setup()
    Twitch.setup()
예제 #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")
예제 #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
예제 #4
0
def pressNum7(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "7"
    keyboard.press(key)
    keyboard.release(key)
예제 #5
0
def Fullscreen(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "f" 
    keyboard.press(key)
    keyboard.release(key)
예제 #6
0
def pressDownArrow(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.down)
    keyboard.release(Key.down)
예제 #7
0
def pressRightArrow(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.right)
    keyboard.release(Key.right)
예제 #8
0
def miniplayer(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "i" 
    keyboard.press(key)
    keyboard.release(key)
예제 #9
0
def pressESC(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.esc)
    keyboard.release(Key.esc)
예제 #10
0
def theaterMode(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "t" 
    keyboard.press(key)
    keyboard.release(key)
예제 #11
0
def mute(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "m" 
    keyboard.press(key)
    keyboard.release(key)
예제 #12
0
def closePlayer(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    key =  "x" 
    keyboard.press(key)
    keyboard.release(key)
예제 #13
0
def pressSpacebar(Program):
    WindowsProgramControl.switchFocus(Program)
    keyboard = Controller()
    keyboard.press(Key.space)
    keyboard.release(Key.space)