ym2149-common
Shared traits and types for YM2149 chiptune replayers.
Overview
This crate provides the unified interface that all replayer crates (ym2149-ym-replayer, ym2149-arkos-replayer, ym2149-ay-replayer, ym2149-sndh-replayer) implement. It enables writing format-agnostic code that works with any chiptune player.
Key Types
Trait Hierarchy
ChiptunePlayerBase (object-safe)
│
└── ChiptunePlayer (adds metadata access)
ChiptunePlayerBase trait
Object-safe base trait for playback operations. Use this when you need trait objects (Box<dyn ChiptunePlayerBase>):
use ;
ChiptunePlayer trait
Extends ChiptunePlayerBase with metadata access. Use this when you need the specific metadata type:
use ;
PlaybackMetadata trait
Unified metadata access across all formats:
use PlaybackMetadata;
PlaybackState enum
Standard playback states used by all players:
use PlaybackState;
match player.state
BasicMetadata struct
A concrete metadata type for simple use cases:
use BasicMetadata;
let meta = BasicMetadata ;
Usage
Add to your Cargo.toml:
[]
= "0.7"
All replayer crates re-export these types, so you typically don't need to depend on ym2149-common directly:
// These are equivalent:
use ;
use ;
use ;
use ;
use ;
License
MIT