예제 #1
0
파일: pdt_supp.cpp 프로젝트: fgroen/zxtune
    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);
      }
    }
예제 #2
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");
     }
   }
 }
예제 #3
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");
     }
   }
 }