void GetNewChannelState(const Cell& src, OrnamentState& ornamentState, DAC::ChannelDataBuilder& builder) { if (const bool* enabled = src.GetEnabled()) { builder.SetEnabled(*enabled); if (!*enabled) { builder.SetPosInSample(0); } } if (const uint_t* note = src.GetNote()) { if (const uint_t* ornament = src.GetOrnament()) { ornamentState.Object = Data->Ornaments.Find(*ornament); ornamentState.Position = 0; builder.SetNoteSlide(ornamentState.GetOffset()); } if (const uint_t* sample = src.GetSample()) { builder.SetSampleNum(*sample); } builder.SetNote(*note); builder.SetPosInSample(0); } }
void SynthesizeChannelsData(DAC::TrackBuilder& track) { for (uint_t chan = 0; chan != CHANNELS_COUNT; ++chan) { OrnamentState& ornament = Ornaments[chan]; ornament.Update(); DAC::ChannelDataBuilder builder = track.GetChannel(chan); builder.SetNoteSlide(ornament.GetOffset()); } }