void SynthesizeChannelsData(DAC::TrackBuilder& track) { for (uint_t chan = 0; chan != CHANNELS_COUNT; ++chan) { GlissData& gliss(Gliss[chan]); if (gliss.Update()) { DAC::ChannelDataBuilder builder = track.GetChannel(chan); builder.SetFreqSlideHz(StepToHz(gliss.Sliding)); } } }
void GetNewChannelState(const Cell& src, GlissData& gliss, DAC::ChannelDataBuilder& builder) { if (src.HasData()) { builder.SetLevelInPercents(100); } if (const bool* enabled = src.GetEnabled()) { builder.SetEnabled(*enabled); if (!*enabled) { builder.SetPosInSample(0); } } if (const uint_t* note = src.GetNote()) { builder.SetNote(*note); } if (const uint_t* sample = src.GetSample()) { builder.SetSampleNum(*sample); builder.SetPosInSample(0); builder.SetFreqSlideHz(0); gliss.Sliding = 0; } if (const uint_t* volume = src.GetVolume()) { const uint_t level = *volume; builder.SetLevelInPercents(100 * level / 16); } for (CommandsIterator it = src.GetCommands(); it; ++it) { switch (it->Type) { case GLISS: gliss.Glissade = it->Param1; break; default: assert(!"Invalid command"); } } }