Exemple #1
0
        internal clsMute Copy()
        {
            clsMute mute = new clsMute();

            foreach (clsTrks.T trk in MutedTrackFromStart.Next)
            {
                mute.MutedTrackFromStart[trk] = MutedTrackFromStart[trk];
                mute.MutedTracks[trk]         = MutedTracks[trk];
            }
            mute.SoloTracks = SoloTracks;
            mute.ExclCh10   = ExclCh10;
            mute.Trks       = Trks;
            return(mute);
        }
Exemple #2
0
        //internal void StartRecord(Form playform, clsFileStream filestream, clsMute mute) {
        //  if (P.F.FileStreamMM != null) P.F.FileStreamMM.InitRec();
        //  StartPlayRecord(playform, filestream, mute);
        //}

        //internal void StartPlay(Form playform, clsFileStream filestream, clsMute mute) {
        //  StartPlayRecord(playform, filestream, mute);
        //}

        internal void StartPlay(Form playform, clsFileStream filestream, clsMute mute)
        {
            //* called from form thread
            //if (PlayCmdOn) DebugPlay();  //already playing?
            PlayableForms.CmdState_Stopped(); //before play starts - in case it fails
            RefreshBBTTimer.Stop();
            BBTQueue.Clear();

            //if (P.F.AutoSync != null && (!P.F.MidiFileLoaded || !P.frmStart.chkPlayMidiPriority.Checked)) {
            if (MidiPlay.OutMStream == null)
            {
                return;
            }
            P.F.Mute.StartPlay();
            //if (P.F.CurrentBBT.Bar >= new clsMTime.clsBBT(P.F.MaxTicks).Bar - 2) return;  //don't start too near the end
            if (P.F.CurrentBBT.Bar >= P.F.MaxBBT.Bar - 2)
            {
                return;                                      //don't start too near the end
            }
            if (/*clsPlay.PlayExists() &&*/ Forms.frmSC.MenuMonitor)
            {
                clsPlay.InitStopwatch();
            }
            Forms.frmSC.ShowfrmPCKBIn();
            if (P.frmSC.Play != null)
            {
                P.frmSC.Play.BBTSwitch = null;
                P.frmSC.Play.NewReset();
            }
            ShowGCCollectionCounts("Start Play");
            P.F.WaitPlay  = new clsWaitPlay(filestream, MidiPlay.OutMStream, mute);
            StreamStartBB = P.F.CurrentBBT.Copy();
            BeatCount     = StreamStartBB.Bar;
            try {
                //lock (TimerLock) {
                P.F.WaitPlay.Start();
                //}
            }
            catch {
                DebugPlay();
                return;
            }

            //if (P.frmStart.chkPlaySustain.Checked) clsPlay.clsSustain.PlayPedalStatic(true);
            //clsPlayKeyboard.PlayNearestChordNote = P.frmStart.chkPlayKBChord.Checked;
            P.frmStart.StreamPlayOnAll();      //enable/disable StartPlay/StopPlay etc.
            P.frmStart.FormsStreamOnOff(true); //enable/disable controls (not StartPlay/StopPlay etc.)
        }
 internal clsWaitPlay(clsFileStream filestream, iBassMidiOut bassout, clsMute mute)
 {
     Resolution          = (int)P.frmStart.nudPlayResolution.Value;
     HalfResolution      = Resolution / 2;
     dStartPlay          = new delStartPlay(StartPlay);
     PlayThread          = new Thread(new ThreadStart(StartPlay));
     PlayThread.Priority = ThreadPriority.AboveNormal;
     PlayThread.Name     = "Play Thread";
     //Debug.WriteLine("clsWaitPlay: ThreadId = " + PlayThread.ManagedThreadId);
     FileStream   = filestream;
     BASSOut      = bassout;
     Mute         = mute;
     dUpdateTempo = new delegUpdateTempo(P.frmStart.UpdateLblTempo);
     ResetAllCtlrsTimer.AutoReset = false;
     ResetAllCtlrsTimer.Elapsed  += ResetAllCtlrsTimer_Elapsed;
 }
            //internal void Stop() {
            //  if (MidiStream == null) return;
            //  indStop = true;
            //}

            internal static bool BypassEv(clsFileStream filestream, clsMute mute, clsEvStrm ev)
            {
                //* return true to bypass
                if (ev is clsFileStream.clsEvBeat)
                {
                    return(false);                        //retain beats
                }
                if (ev.Trk == null)
                {
                    return(false);         //retain conductor trk
                }
                if (ev is clsEvTempo)
                {
                    return(false);           //retain meta msgs (tempo)
                }
                if (ev is clsEvSystem)
                {
                    return(true);            //bypass system/meta
                }
                if (ev is clsEvMeta)
                {
                    return(true);          //bypass system/meta
                }
                clsEvShort evshort      = (clsEvShort)ev;
                byte       status       = evshort.Status;
                int        statusprefix = status & 0xf0;

                if (statusprefix >= 0xf0)
                {
                    return(false);
                }
                bool on   = (statusprefix == 0x90 && evshort.Data > 0); //all others evs = OFF
                int  chan = status & 0x0f;

                if (mute.MutedEv(ev.Trk, chan, on))
                {
                    return(true);
                }
                if (statusprefix != 0x90 && statusprefix != 0x80)
                {
                    return(filestream.MidiCtlrs.Bypass(evshort));
                }
                return(false);
            }