Guides for developers
GitHub repositoryHomepage
  • Getting started
  • Core
    • Glossary
    • The structure of the LMMS core
      • Initializations and cleanups
        • For core
      • Accessing to core classes
    • The structure of an LMMS project
    • Tracks and track containers
      • Tracks and clips
      • Track containers
    • The pattern system
    • Play handles
      • NotePlayHandle
      • InstrumentPlayHandle
      • SamplePlayHandle
    • Instruments
      • The type of instruments
      • Processing in instruments
        • Per-note processing
    • Audio effects
    • Automation and controllers
      • Automation
        • Processing automation
      • Controllers
    • Controlling playback
    • The audio rendering engine of LMMS
      • Stage 1: collect play handles and process automation
      • Stage 2: render notes and instruments
      • Step 3: mix and master
    • Threading and synchronization
    • Data serialization
      • Overview
      • Relevant classes
      • Upgrading data files
    • Internal routing of events and signals
      • Audio signals
      • MIDI events
    • Audio and MIDI I/O
      • Supported backends and features
  • GUI
    • The initialization process of LMMS GUI
    • UI components of LMMS
  • Build system
    • CMake and LMMS
    • Source directory structure
    • Useful variables/macros
  • Plugin system
    • Plugin types
    • Plugin API
      • Sub-plugin API
    • Loading plugins from LMMS
  • Unit tests
    • Writing unit tests
Powered by GitBook
On this page
  • Types of play handles
  • Important member variables and functions
  • Functions which subclasses should implement

Was this helpful?

  1. Core

Play handles

PreviousThe pattern systemNextNotePlayHandle

Last updated 4 years ago

Was this helpful?

In LMMS, play handles manage playback of notes, instruments, or sample clips. All play handles are managed by subclasses of PlayHandle.

Types of play handles

There are several types of PlayHandles defined:

  • : manages Notes being played, and get audio output for specific note

  • : manages instruments which provides per-instrument audio output(single-streamed instruments)

  • : manages sample playback

  • PresetPreviewHandle

  • SampleRecordHandle

Important member variables and functions

  • m_offset(type f_cnt_t): The number remaining of audio frames before the play handle starts to produce audio, evaluated at the beginning of a rendering period

Functions which subclasses should implement

PlayHandle itself can't be used directly because it doesn't implement some of the required functionalities.

  • play(sampleFrame *buf): Render a period of audio buffer to buf and check/manage the playback state of the managed object

  • isFinished(): Return whether the managed object finished playing and this can be deleted

  • isFromTrack(const Track *track): Check if the play handle plays objects in the given track

NotePlayHandle
InstrumetnPlayHandle
SamplePlayHandle