Пример #1
0
 private static extern int zplay_PlayLoop(
     uint objptr,
     int fFormatStartTime,
     ref TStreamTime pStartTime,
     int fFormatEndTime,
     ref TStreamTime pEndTime,
     uint nNumOfCycles,
     uint fContinuePlaying);
Пример #2
0
 private static extern int zplay_SlideVolume(
     uint objptr,
     TTimeFormat fFormatStart,
     ref TStreamTime pTimeStart,
     int nStartVolumeLeft,
     int nStartVolumeRight,
     TTimeFormat fFormatEnd,
     ref TStreamTime pTimeEnd,
     int nEndVolumeLeft,
     int nEndVolumeRight);
Пример #3
0
        public bool PlayLoop(
            TTimeFormat TimeFormatStart,
            ref TStreamTime StartPosition,
            TTimeFormat TimeFormatEnd,
            ref TStreamTime EndPosition,
            uint NumberOfCycles,
            bool ContinuePlaying)
        {
            uint fContinuePlaying = !ContinuePlaying ? 0U : 1U;

            return(ZPlay.zplay_PlayLoop(this.objptr, Convert.ToInt32((int)TimeFormatStart), ref StartPosition, Convert.ToInt32((int)TimeFormatEnd), ref EndPosition, NumberOfCycles, fContinuePlaying) == 1);
        }
Пример #4
0
 public bool SlideVolume(
     TTimeFormat TimeFormatStart,
     ref TStreamTime TimeStart,
     int StartVolumeLeft,
     int StartVolumeRight,
     TTimeFormat TimeFormatEnd,
     ref TStreamTime TimeEnd,
     int EndVolumeLeft,
     int EndVolumeRight)
 {
     return(ZPlay.zplay_SlideVolume(this.objptr, TimeFormatStart, ref TimeStart, StartVolumeLeft, StartVolumeRight, TimeFormatEnd, ref TimeEnd, EndVolumeLeft, EndVolumeRight) == 1);
 }
Пример #5
0
        public AudioControl(bool usesTimer)
        {
            this.player = new ZPlay();

            this.info = new TStreamInfo();
            this.status = new TStreamStatus();
            this.time = new TStreamTime();

            this.timer = usesTimer ? new System.Windows.Forms.Timer() : null;
            if (this.timer != null)
            {
                this.timer.Interval = 100;
                this.timer.Tick += new EventHandler(timer_Tick);
            }
        }
Пример #6
0
 public bool Seek(TTimeFormat TimeFormat, ref TStreamTime Position, TSeekMethod MoveMethod)
 {
     return zplay_Seek(objptr, TimeFormat, ref Position, MoveMethod) == 1;
 }
Пример #7
0
 public void GetPosition(ref TStreamTime time)
 {
     zplay_GetPosition(objptr, ref time);
 }
Пример #8
0
 private void Button11_Click(object sender, System.EventArgs e)
 {
     TStreamTime startpos = new TStreamTime();
     TStreamTime endpos = new TStreamTime();
     player.GetPosition(ref startpos);
     endpos.sec = System.Convert.ToUInt32(startpos.sec + 2);
     player.PlayLoop(TTimeFormat.tfSecond, ref startpos, TTimeFormat.tfSecond, ref endpos, 3, true);
 }
Пример #9
0
 private static extern void zplay_GetPosition(uint objptr, ref TStreamTime pTime);
Пример #10
0
 private extern static int zplay_Seek(uint objptr, TTimeFormat fFormat, ref TStreamTime pTime, TSeekMethod nMoveMethod);
Пример #11
0
        public bool PlayLoop(TTimeFormat TimeFormatStart, ref TStreamTime StartPosition, TTimeFormat TimeFormatEnd, ref TStreamTime EndPosition, uint NumberOfCycles, bool ContinuePlaying)
        {
            uint continueplay = 0;
            if (ContinuePlaying)
            {
                continueplay = 1;
            }
            else
            {
                continueplay = 0;
            }

            return zplay_PlayLoop(objptr, System.Convert.ToInt32((int)(TimeFormatStart)), ref StartPosition, System.Convert.ToInt32((int)(TimeFormatEnd)), ref EndPosition, NumberOfCycles, continueplay) == 1;
        }
Пример #12
0
 private extern static void zplay_GetPosition(uint objptr, ref TStreamTime pTime);
Пример #13
0
 private static extern int zplay_Seek(
     uint objptr,
     TTimeFormat fFormat,
     ref TStreamTime pTime,
     TSeekMethod nMoveMethod);
Пример #14
0
        private void Timer1_Tick(object sender, System.EventArgs e)
        {
            TStreamTime pos = new TStreamTime();

            player.GetPosition(ref pos);

            if(ProgressBar1.Maximum > pos.sec)
                ProgressBar1.Value = System.Convert.ToInt32((int)(pos.sec));

            position.Text = System.String.Format("{0,2:G}", pos.hms.hour) + " : " + System.String.Format("{0,2:G}", pos.hms.minute) + " : " + System.String.Format("{0,2:G}", pos.hms.second) + " : " + System.String.Format("{0,3:G}", pos.hms.millisecond);

            TStreamStatus Status = new TStreamStatus();
            player.GetStatus(ref Status);

            statuslabel1.Text = "Eq:" + System.Environment.NewLine + "Fade:" + System.Environment.NewLine + "Echo:" + System.Environment.NewLine + "Bitrate:" + System.Environment.NewLine + "Vocal cut:" + System.Environment.NewLine + "Side cut:";

            statuslabel2.Text = "Loop:" + System.Environment.NewLine + "Reverse:" + System.Environment.NewLine + "Play:" + System.Environment.NewLine + "Pause:" + System.Environment.NewLine + "Channel mix:" + System.Environment.NewLine + "Load:";

            statusvalue1.Text = System.Convert.ToString(Status.fEqualizer) + System.Environment.NewLine + System.Convert.ToString(Status.fSlideVolume) + System.Environment.NewLine + System.Convert.ToString(Status.fEcho) + System.Environment.NewLine + System.Convert.ToString(player.GetBitrate(false)) + System.Environment.NewLine + System.Convert.ToString(Status.fVocalCut) + System.Environment.NewLine + System.Convert.ToString(Status.fSideCut);

            TStreamLoadInfo load = new TStreamLoadInfo();
            player.GetDynamicStreamLoad(ref load);
            statusvalue2.Text = System.Convert.ToString(Status.nLoop) + System.Environment.NewLine + System.Convert.ToString(Status.fReverse) + System.Environment.NewLine + System.Convert.ToString(Status.fPlay) + System.Environment.NewLine + System.Convert.ToString(Status.fPause) + System.Environment.NewLine + System.Convert.ToString(Status.fChannelMix) + System.Environment.NewLine + System.Convert.ToString(load.NumberOfBuffers);

            if (Status.fSlideVolume != false)
            {
                BlockLeft = true;
                BlockRight = true;

                int Left = 0;
                int Right = 0;
                player.GetPlayerVolume(ref Left, ref Right);

                leftplayervolume.Value = 100 - Left;
                rightplayervolume.Value = 100 - Right;

            }

            if (FadeFinished)
            {
                int Left = 0;
                int Right = 0;
                player.GetPlayerVolume(ref Left, ref Right);

                leftplayervolume.Value = 100 - Left;
                rightplayervolume.Value = 100 - Right;
                FadeFinished = false;
            }

            if(NextSong)
            {
                showinfo();
                NextSong = false;
            }
        }
Пример #15
0
        private void ProgressBar1_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            TStreamTime newpos = new TStreamTime();

            TStreamInfo Info = new TStreamInfo();
            player.GetStreamInfo(ref Info);

            newpos.sec = System.Convert.ToUInt32(e.X * Info.Length.sec / System.Convert.ToDouble(((ProgressBar)sender).Size.Width));
            player.Seek(TTimeFormat.tfSecond, ref newpos, TSeekMethod.smFromBeginning);
        }
Пример #16
0
 private void Button9_Click(object sender, System.EventArgs e)
 {
     TStreamTime newpos = new TStreamTime();
     newpos.sec = 5;
     player.Seek(TTimeFormat.tfSecond, ref newpos, TSeekMethod.smFromCurrentBackward);
 }
Пример #17
0
        private void Button14_Click(object sender, System.EventArgs e)
        {
            int left = 0;
            int right = 0;
            TStreamTime startpos = new TStreamTime();
            TStreamTime endpos = new TStreamTime();

            player.GetPlayerVolume(ref left, ref right);
            player.GetPosition(ref startpos);
            endpos.sec = System.Convert.ToUInt32(startpos.sec + 5);
            player.SlideVolume(TTimeFormat.tfSecond, ref startpos, left, right, TTimeFormat.tfSecond, ref endpos, 0, 0);
        }
Пример #18
0
 public bool SlideVolume(TTimeFormat TimeFormatStart, ref TStreamTime TimeStart, int StartVolumeLeft, int StartVolumeRight, TTimeFormat TimeFormatEnd, ref TStreamTime TimeEnd, int EndVolumeLeft, int EndVolumeRight)
 {
     return zplay_SlideVolume(objptr, TimeFormatStart, ref TimeStart, StartVolumeLeft, StartVolumeRight, TimeFormatEnd, ref TimeEnd, EndVolumeLeft, EndVolumeRight) == 1;
 }
Пример #19
0
 public void GetPosition(ref TStreamTime time)
 {
     ZPlay.zplay_GetPosition(this.objptr, ref time);
 }
Пример #20
0
 private extern static int zplay_PlayLoop(uint objptr, int fFormatStartTime, ref TStreamTime pStartTime, int fFormatEndTime, ref TStreamTime pEndTime, uint nNumOfCycles, uint fContinuePlaying);
Пример #21
0
 public bool Seek(TTimeFormat TimeFormat, ref TStreamTime Position, TSeekMethod MoveMethod)
 {
     return(ZPlay.zplay_Seek(this.objptr, TimeFormat, ref Position, MoveMethod) == 1);
 }
Пример #22
0
 private extern static int zplay_SlideVolume(uint objptr, TTimeFormat fFormatStart, ref TStreamTime pTimeStart, int nStartVolumeLeft, int nStartVolumeRight, TTimeFormat fFormatEnd, ref TStreamTime pTimeEnd, int nEndVolumeLeft, int nEndVolumeRight);
Пример #23
0
 public bool Seek(PlayerSeekOrigin origin, uint offset)
 {
     switch (plStatus)
     {
         case PlayerStatus.Playing:
         case PlayerStatus.Paused:
             {
                 TStreamTime seekTime = new TStreamTime() { ms = offset };
                 bool r = player.Seek(TTimeFormat.tfMillisecond, ref seekTime, TranslateSeek(origin));
                 Update();
                 return r;
             }
         case PlayerStatus.Stopped:
             return false;
         case PlayerStatus.NoFileOpen:
             return false;
         default:
             throw new NotImplementedException();
     }
 }