Download Now
Forums

    Reference Codebot.Hardware.pas

    Part of the Codebot Render package

    The Codebot.Hardware unit plays audio and reads the keyboard, mouse, and joysticks using SDL alone, so it works the same in both hosts.

    You add sounds and music to Audio as named sources from files, streams, or assets, and they are kept in memory. To play a source it is loaded into one of a fixed number of banks, each with its own volume, pan, position, and loop count, and the banks that are playing are mixed together on the audio thread. MP3, Ogg Vorbis, uncompressed WAV, and tracker music such as MOD, S3M, XM, and IT are supported. Every source must be stereo with 16 bit samples at 44100 Hz, and a source in any other format is refused when you add it. If no audio device can be opened, sources and banks still work but nothing is heard.

    Keyboard, Mouse, and Joysticks hold the state of the hardware as it was at the start of the frame, when the hosts call ScanHardware. You can check whether a key is down, or was just pressed or released. When SDL recognizes a joystick as a gamepad, you also get its named buttons and axes.

    Items 185 items

    NameKindLine
    Audiofunction375
    AudioFormatDetectfunction106, 108
    AudioFormatNamesconstant96
    AudioFormatTimefunction110, 112
    DefAudioBankCountconstant65
    DefBitsPerSampleconstant69
    DefChannelsconstant67
    DefMixingSamplesconstant73
    DefMixingSizeconstant75
    DefSampleRateconstant71
    EAudioExceptionclass78
    EAudioFormatExceptionclass81
    IsKeyDownfunction423
    Joysticksfunction623
    Keyboardfunction413
    Mousefunction500
    PAudioSamplepointer273
    PumpHardwareprocedure635
    ScanHardwareprocedure629
    ScanHardwarePumpsvariable641
    TAudioclass291
    Addfunction325, 327
    AddAssetfunction331
    BankExistsfunction321
    Createconstructor318
    Destroydestructor319
    IsPlayingfunction323
    Nextfunction340
    Playfunction346, 349, 352
    Removeprocedure333
    Sourcefunction335, 337
    Availableproperty355
    BankCountproperty367
    Banksproperty365
    OnMixproperty371
    Pausedproperty357
    SourceCountproperty363
    Sourcesproperty361
    Volumeproperty359
    TAudioBankclass178
    Createconstructor211
    Destroydestructor212
    FadeInprocedure225
    FadeOutprocedure228
    Loadprocedure214, 216, 218
    Resetprocedure231
    Unloadprocedure220
    Completedproperty238
    Durationproperty235
    Loopproperty248
    LoopCountproperty246
    Mutedproperty250
    Panproperty253
    Pausedproperty242
    Positionproperty258
    Reservedproperty264
    Sourceproperty233
    Volumeproperty261
    TAudioDecoderclass156
    Createconstructor166
    Decodefunction171
    GetPositionfunction163
    SetPositionprocedure164
    Positionproperty173
    TAudioFormatenum84
    afUnsupportedenum value85
    afMp3enum value87
    afTrackerenum value89
    afVorbisenum value91
    afWaveenum value93
    TAudioMixEventprocedural284
    TAudioOffsetsarray118
    TAudioSamplerecord268
    Leftfield269
    Rightfield270
    TAudioSourceclass131
    Createconstructor141
    Destroydestructor142
    Durationproperty148
    Formatproperty150
    Idproperty146
    Nameproperty144
    TGamepadAxisenum517
    gaLeftXenum value517
    gaLeftYenum value517
    gaRightXenum value517
    gaRightYenum value517
    gaLeftTriggerenum value517
    gaRightTriggerenum value518
    TGamepadButtonenum511
    gbAenum value511
    gbBenum value511
    gbXenum value511
    gbYenum value511
    gbBackenum value511
    gbGuideenum value511
    gbStartenum value511
    gbLeftStickenum value511
    gbRightStickenum value512
    gbLeftShoulderenum value512
    gbRightShoulderenum value512
    gbUpenum value512
    gbDownenum value512
    gbLeftenum value512
    gbRightenum value513
    TJoystickclass530
    Createconstructor558
    Destroydestructor559
    Attachedproperty563
    Axesproperty576
    AxisCountproperty571
    ButtonCountproperty577
    Buttonsproperty579
    GamepadAxesproperty570
    GamepadButtonsproperty568
    HatCountproperty581
    Hatsproperty582
    IsGamepadproperty565
    Nameproperty561
    TrackballCountproperty584
    Trackballsproperty585
    TJoystickHatenum506
    hatCenterenum value506
    hatUpenum value506
    hatRightenum value506
    hatDownenum value506
    hatLeftenum value506
    hatRightUpenum value506
    hatRightDownenum value507
    hatLeftUpenum value507
    hatLeftDownenum value507
    TJoysticksclass591
    Axisfunction609
    ButtonDownfunction607
    Createconstructor603
    Destroydestructor604
    GamepadAxisfunction615
    GamepadDownfunction612
    Countproperty617
    Joystickproperty619
    TJoystickTrackballrecord521
    XDeltafield522
    YDeltafield523
    TKeyboardclass389
    Keyproperty403
    Pressedproperty405
    Releasedproperty407
    ShiftStateproperty409
    TKeyStatesarray381
    TMouseclass444
    Destroydestructor472
    Buttonproperty476
    Buttonsproperty474
    Capturedproperty491
    Cursorproperty496
    Pressedproperty478
    Releasedproperty480
    Visibleproperty493
    Xproperty483
    XDeltaproperty487
    Yproperty484
    YDeltaproperty488
    TMouseCursorenum437
    cursorDefaultenum value437
    cursorNoneenum value437
    cursorArrowenum value437
    cursorIBeamenum value437
    cursorWaitenum value438
    cursorCrossenum value438
    cursorHandenum value438
    cursorNoenum value438
    cursorSizeAllenum value438
    cursorSizeNSenum value438
    cursorSizeWEenum value439
    cursorSizeNWSEenum value439
    cursorSizeNESWenum value439
    TSceneButtonenum430
    buttonNoneenum value430
    buttonLeftenum value430
    buttonRightenum value430
    buttonMiddleenum value430
    buttonExtra1enum value431
    buttonExtra2enum value431
    TSceneButtonsset433
    VirtualKeyfunction416