Beispiel #1
0
 public void SwitchKey()
 {
     lock (P.F.AudioSync) {
         if (!clsAudioSync.StaticMP3Playing || clsAudioSync.Cmd == clsAudioSync.eCmd.Play)
         {
             return;
         }
         if (clsBASSOutDev.Disconnected)
         {
             return;
         }
         long posbytes = GetPosBytes();
         using (new clsPlay.clsMonitor()) {
             if (clsAudioSync.indFirstSwitchKey) //assumes CurrentBBT.BeatRemBars = 0
             {
                 RemovePosSync();
                 Elapsed.ResetRecord();
                 //AutoSync.SetCmdRecordActive();
                 clsMTime.clsBBT bbt = P.F.BarPaneBBTLo;
                 if (clsAudioSync.Cmd == clsAudioSync.eCmd.PlayAndRecord &&
                     P.F.BarPaneBBTHi.Bar > P.F.BarPaneBBTLo.Bar &&
                     CurrentBBT.Beats == P.F.BarPaneBBTLo.Beats)
                 {
                     for (int b = P.F.BarPaneBBTLo.Beats; b <= P.F.BarPaneBBTHi.Beats; b++)
                     {
                         Elapsed.SetRecord(b, -1); //jump
                     }
                     bbt = P.F.BarPaneBBTHi;       //jump to this
                 }
                 Elapsed.SetRecord(bbt.Beats, posbytes);
                 CurrentBBT = bbt.Copy();
             }
             else
             {
                 //AutoSync.SetCmdRecordInactive();
                 CurrentBBT.NextBeat();
                 Elapsed.SetRecord(CurrentBBT.Beats, GetPosBytes());
                 indSave = true;
             }
         }
         clsAudioSync.indFirstSwitchKey = false;
         AudioSync.RefreshBBT();
         if (P.F.frmAutoSync != null)
         {
             P.F.frmAutoSync.BeginInvoke(new clsAudioSync.delegUpdateCurrentPos(P.F.frmAutoSync.UpdateCurrentPos));
         }
     }
 }