Ejemplo n.º 1
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());
   }
 }
Ejemplo n.º 2
0
 void SynthesizeChannelsData(DAC::TrackBuilder& track)
 {
   for (uint_t chan = 0; chan != CHANNELS_COUNT; ++chan)
   {
     VolumeState& vol = Volumes[chan];
     if (vol.Update())
     {
       DAC::ChannelDataBuilder builder = track.GetChannel(chan);
       builder.SetLevelInPercents(100 * vol.Value / 16);
     }
   }
 }
Ejemplo n.º 3
0
 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));
     }
   }
 }
Ejemplo n.º 4
0
    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);
      }
    }
Ejemplo n.º 5
0
 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");
     }
   }
 }
Ejemplo n.º 6
0
 void GetNewChannelState(const Cell& src, VolumeState& vol, DAC::ChannelDataBuilder& builder)
 {
   if (const bool* enabled = src.GetEnabled())
   {
     builder.SetEnabled(*enabled);
     if (!*enabled)
     {
       builder.SetPosInSample(0);
     }
   }
   if (const uint_t* note = src.GetNote())
   {
     builder.SetNote(*note);
     builder.SetPosInSample(0);
   }
   if (const uint_t* sample = src.GetSample())
   {
     builder.SetSampleNum(*sample);
     builder.SetPosInSample(0);
   }
   if (const uint_t* volume = src.GetVolume())
   {
     vol.Value = *volume;
     builder.SetLevelInPercents(100 * vol.Value / 16);
   }
   for (CommandsIterator it = src.GetCommands(); it; ++it)
   {
     switch (it->Type)
     {
     case VOLUME_SLIDE_PERIOD:
       vol.SlideCounter = vol.SlidePeriod = it->Param1;
       break;
     case VOLUME_SLIDE:
       vol.SlideDirection = it->Param1;
       break;
     default:
       assert(!"Invalid command");
     }
   }
 }