# Module smpeg

# Imports

sdl

# Types

    TFilterInfo = object
      yuv_mb_square_error*: PUInt16
      yuv_pixel_square_error*: PUInt16

    PFilterInfo = ptr TFilterInfo

    PFilter = ptr TFilter

    TFilterCallback = proc (dest, source: POverlay; region: PRect;
                            filter_info: PFilterInfo; data: pointer): pointer {.
        cdecl.}

    TFilterDestroy = proc (Filter: PFilter): pointer {.cdecl.}

    TFilter = object
      flags*: uint32
      data*: pointer
      callback*: TFilterCallback
      destroy*: TFilterDestroy

    TVersion = object
      major*: Byte
      minor*: Byte
      patch*: Byte

    Pversion = ptr TVersion

    TSMPEG = object

    PSMPEG = ptr TSMPEG

    TInfo = object
      has_audio*: int32
      has_video*: int32
      width*: int32
      height*: int32
      current_frame*: int32
      current_fps*: float64
      audio_string*: array[0 .. 79, char]
      audio_current_frame*: int32
      current_offset*: uint32
      total_size*: uint32
      current_time*: float64
      total_time*: float64

    PInfo = ptr TInfo

    Tstatus = int32

    Pstatus = ptr int32

    TDisplayCallback = proc (dst: PSurface; x, y: int; w, h: int): pointer {.cdecl.}

# Consts

    FILTER_INFO_MB_ERROR = 1

    FILTER_INFO_PIXEL_ERROR = 2

    MAJOR_VERSION = 0

    MINOR_VERSION = 4

    PATCHLEVEL = 2

    STATUS_ERROR = -1

    STATUS_STOPPED = 0

    STATUS_PLAYING = 1

# Procs

    proc filter_null(): PFilter {.cdecl, importc: "SMPEGfilter_null",
                                  dynlib: SmpegLibName.}

    proc filter_bilinear(): PFilter {.cdecl, importc: "SMPEGfilter_bilinear",
                                      dynlib: SmpegLibName.}

    proc filter_deblocking(): PFilter {.cdecl, importc: "SMPEGfilter_deblocking",
                                        dynlib: SmpegLibName.}

    proc SMPEG_new(theFile: cstring; info: PInfo; audio: int): PSMPEG {.cdecl,
        importc: "SMPEG_new", dynlib: SmpegLibName.}

    proc new_descr(theFile: int; info: PInfo; audio: int): PSMPEG {.cdecl,
        importc: "SMPEG_new_descr", dynlib: SmpegLibName.}

    proc new_data(data: pointer; size: int; info: PInfo; audio: int): PSMPEG {.
        cdecl, importc: "SMPEG_new_data", dynlib: SmpegLibName.}

    proc getinfo(mpeg: PSMPEG; info: PInfo) {.cdecl, importc: "SMPEG_getinfo",
        dynlib: SmpegLibName.}

    proc enableaudio(mpeg: PSMPEG; enable: int) {.cdecl,
        importc: "SMPEG_enableaudio", dynlib: SmpegLibName.}

    proc enablevideo(mpeg: PSMPEG; enable: int) {.cdecl,
        importc: "SMPEG_enablevideo", dynlib: SmpegLibName.}

    proc delete(mpeg: PSMPEG) {.cdecl, importc: "SMPEG_delete", dynlib: SmpegLibName.}

    proc status(mpeg: PSMPEG): Tstatus {.cdecl, importc: "SMPEG_status",
                                         dynlib: SmpegLibName.}

    proc setvolume(mpeg: PSMPEG; volume: int) {.cdecl, importc: "SMPEG_setvolume",
        dynlib: SmpegLibName.}

    proc setdisplay(mpeg: PSMPEG; dst: PSurface; surfLock: PMutex;
                    callback: TDisplayCallback) {.cdecl,
        importc: "SMPEG_setdisplay", dynlib: SmpegLibName.}

    proc loop(mpeg: PSMPEG; repeat: int) {.cdecl, importc: "SMPEG_loop",
                                           dynlib: SmpegLibName.}

    proc scaleXY(mpeg: PSMPEG; width, height: int) {.cdecl,
        importc: "SMPEG_scaleXY", dynlib: SmpegLibName.}

    proc scale(mpeg: PSMPEG; scale: int) {.cdecl, importc: "SMPEG_scale",
                                           dynlib: SmpegLibName.}

    proc move(mpeg: PSMPEG; x, y: int) {.cdecl, importc: "SMPEG_move",
                                         dynlib: SmpegLibName.}

    proc setdisplayregion(mpeg: PSMPEG; x, y, w, h: int) {.cdecl,
        importc: "SMPEG_setdisplayregion", dynlib: SmpegLibName.}

    proc play(mpeg: PSMPEG) {.cdecl, importc: "SMPEG_play", dynlib: SmpegLibName.}

    proc pause(mpeg: PSMPEG) {.cdecl, importc: "SMPEG_pause", dynlib: SmpegLibName.}

    proc stop(mpeg: PSMPEG) {.cdecl, importc: "SMPEG_stop", dynlib: SmpegLibName.}

    proc rewind(mpeg: PSMPEG) {.cdecl, importc: "SMPEG_rewind", dynlib: SmpegLibName.}

    proc seek(mpeg: PSMPEG; bytes: int) {.cdecl, importc: "SMPEG_seek",
                                          dynlib: SmpegLibName.}

    proc skip(mpeg: PSMPEG; seconds: float32) {.cdecl, importc: "SMPEG_skip",
        dynlib: SmpegLibName.}

    proc renderFrame(mpeg: PSMPEG; framenum: int) {.cdecl,
        importc: "SMPEG_renderFrame", dynlib: SmpegLibName.}

    proc renderFinal(mpeg: PSMPEG; dst: PSurface; x, y: int) {.cdecl,
        importc: "SMPEG_renderFinal", dynlib: SmpegLibName.}

    proc filter(mpeg: PSMPEG; filter: PFilter): PFilter {.cdecl,
        importc: "SMPEG_filter", dynlib: SmpegLibName.}

    proc error(mpeg: PSMPEG): cstring {.cdecl, importc: "SMPEG_error",
                                        dynlib: SmpegLibName.}

    proc playAudio(mpeg: PSMPEG; stream: pointer; length: int): int {.cdecl,
        importc: "SMPEG_playAudio", dynlib: SmpegLibName.}

    proc playAudioSDL(mpeg: pointer; stream: pointer; length: int) {.cdecl,
        importc: "SMPEG_playAudioSDL", dynlib: SmpegLibName.}

    proc wantedSpec(mpeg: PSMPEG; wanted: PAudioSpec): int {.cdecl,
        importc: "SMPEG_wantedSpec", dynlib: SmpegLibName.}

    proc actualSpec(mpeg: PSMPEG; spec: PAudioSpec) {.cdecl,
        importc: "SMPEG_actualSpec", dynlib: SmpegLibName.}

    proc Double(mpeg: PSMPEG; doubleit: bool) {.raises: [], tags: [].}

    proc GETVERSION(X: var TVersion) {.raises: [], tags: [].}

Generated: 2013-05-21 09:55:05 UTC