File: __init__.py

package info (click to toggle)
pyepl 1.1.0-3.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,120 kB
  • sloc: cpp: 7,986; python: 6,026; makefile: 360; ansic: 132
file content (105 lines) | stat: -rw-r--r-- 2,676 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# PyEPL: hardware/__init__.py
#
# Copyright (C) 2003-2005 Michael J. Kahana
# Authors: Ian Schleifer, Per Sederberg, Aaron Geller, Josh Jacobs
# URL: http://memory.psych.upenn.edu/programming/pyepl
#
# Distributed under the terms of the GNU Lesser General Public License
# (LGPL). See the license.txt that came with this file.

"""
This package provides an interface to all the hardware and platform
specific functionality that pyEPL needs.  The interface should always
work the same regardless of the underlying implementation.
"""

import eventpoll
import keyboard
import graphics
import mouse
import joystick
import timing
import vr
import rt
import eeg
import sound

import pygame
import sys

modules = [timing, keyboard, mouse, joystick, graphics, eventpoll, vr, eeg, sound]

def initialize(**options):
    global modules
    pygame.init()
    pygame.mixer.quit()
    for m in modules:
        m.initialize(**options)

def finalize():
    global modules
    rmodules = modules[:]
    rmodules.reverse()
    for m in rmodules:
        m.finalize()
    pygame.quit()

# Timing Features
universal_time = timing.universal_time
timedCall = timing.timedCall
pollEvents = eventpoll.pollEvents
addPollCallback = eventpoll.addPollCallback
removePollCallback = eventpoll.removePollCallback
delay = timing.delay
wait = timing.wait
uSleep = timing.uSleep

# Keyboard Features
nameToKey = keyboard.nameToKey
keyToName = keyboard.keyToName
keyNames = keyboard.keyNames
setKeyboardCallback = keyboard.setKeyboardCallback

# Mouse Features
setMousePosition = mouse.setMousePosition
setMouseVisibility = mouse.setMouseVisibility
setMouseCallbacks = mouse.setMouseCallbacks
getMouseRange = mouse.getMouseRange

# Joystick Features
getJoystickFeatures = joystick.getJoystickFeatures
setJoystickCallbacks = joystick.setJoystickCallbacks

# Graphics Features
toggleFullscreen = graphics.toggleFullscreen
getFullscreen = graphics.getFullscreen
getResolution = graphics.getResolution
setVideoCaption = graphics.setVideoCaption
clearScreen = graphics.clearScreen
makeVideoChanges = graphics.makeVideoChanges
startVideo = graphics.startVideo
stopVideo = graphics.stopVideo
setGammaRamp = graphics.setGammaRamp
getShowFPS = graphics.getShowFPS


# EEG Features
if sys.platform=='darwin':
    AWCard = eeg.awCard
else:
    Parallel = eeg.Parallel
    EEGShmAttached = eeg.shmAttached
    EEGShmAttach = eeg.shmAttach
    EEGShmDetach = eeg.shmDetach
    EEGRecStart = eeg.recStart
    EEGRecStop = eeg.recStop
    EEGGetOffset = eeg.getOffset
    EPLScalpEEGException = eeg.EPLScalpEEGException

# Sound Features
EPLSound = sound.EPLSound
SoundFile = sound.SoundFile

# VR Features

# GUI Features