Ejemplo n.º 1
0
 public ReferenceHolder(bool Free = true)
 {
     if (Free)
     {
         _freeproc = Callback;
     }
 }
Ejemplo n.º 2
0
 public BassPlayerEngine(bool isMobile, bool crossFade, double deviceBufferSize)
 {
     DeviceBufferSize = deviceBufferSize;
     Init(isMobile);
     crossFade = CrossfadeEnabled;
     _sync     = EndSync;
     _posSync  = PositonReachedSync;
 }
Ejemplo n.º 3
0
        //internal clsMTime.clsBBT AudioPlayStartBBT {  //Bar pane (blue highlight)
        //  get {
        //    //return Forms.frmTrackMap.BarPaneBBT;
        //    return P.F.CurrentBBT;
        //  }
        //}

        internal clsMP3Bass(clsAudioSync autosync, string filepath)
        {
            AudioSync = autosync;
            FilePath  = filepath;
            OpenStream();
            delegOnEnd = new SyncProcedure(OnEnd);
            delegOnPos = new SyncProcedure(OnPos);
            P.frmSC.panTrkAudio.Enabled = true;
            Vol = P.frmSC.trkAudioVol.Value;
            Pan = P.frmSC.trkAudioPan.Value;
        }
Ejemplo n.º 4
0
 public static (SyncProcedure proc, IntPtr user) CreateProcedure(SyncProcedure proc, IntPtr user = default(IntPtr))
 {
     if (user == default(IntPtr))
     {
         user = new IntPtr(currenSyncProc++);
     }
     if (currenSyncProc > 1000)
     {
         currenSyncProc = 0;
     }
     SyncProcs[user] = proc;
     return(SyncProcWrapper, user);
 }
Ejemplo n.º 5
0
        public NetworkDecoder(string Url, Resolution BufferKind = Resolution.Short, Action <BufferProvider> callback = null)
            : base(BufferKind)
        {
            this.Url = Url;

            if (callback != null)
            {
                call = callback;
                proc = new DownloadProcedure(Callback);
            }

            Down_Handler = new SyncProcedure(OnDownloadCompleted);

            Handle = Bass.CreateStream(Url, 0, BufferKind.ToBassFlag() | BassFlags.Decode | BassFlags.Unicode, (callback != null ? proc : null), IntPtr.Zero);

            Bass.ChannelSetSync(Handle, SyncFlags.Downloaded, 0, Down_Handler, IntPtr.Zero);
        }
Ejemplo n.º 6
0
        public Player(string filepath, double volume, bool streaming)
        {
            this.FilePath = filepath;
            Ended         = false;
            if (streaming)
            {
                this.reader = new MusicFileReaderStreaming(filepath);
            }
            else
            {
                this.reader = new MusicFileReader(filepath);
            }

            this.IsLoop = !string.IsNullOrEmpty(reader.Tags.GetTag("LOOPSTART")) && (!string.IsNullOrEmpty(reader.Tags.GetTag("LOOPLENGTH")) || !string.IsNullOrEmpty(reader.Tags.GetTag("LOOPEND")));
            if (this.IsLoop)
            {
                LoopStart = long.Parse(reader.Tags.GetTag("LOOPSTART"));
                if (!string.IsNullOrEmpty(reader.Tags.GetTag("LOOPLENGTH")))
                {
                    LoopEnd = LoopStart + long.Parse(reader.Tags.GetTag("LOOPLENGTH"));
                }
                else
                {
                    LoopEnd = long.Parse(reader.Tags.GetTag("LOOPEND"));
                }
            }
            else
            {
                LoopStart = 0;
                LoopEnd   = reader.TotalSamples;
            }

            this.tSTREAMPROC  = new StreamProcedure(this.StreamProc);
            this.tSYNCPROC    = new SyncProcedure(this.EndProc);
            this.StreamHandle = Bass.CreateStream(reader.SampleRate, reader.Channels, BassFlags.Float, this.tSTREAMPROC);
            ChangeVolume(volume);
            Bass.ChannelSetSync(this.StreamHandle, SyncFlags.Stalled, 0, this.tSYNCPROC);

            Bass.ChannelPlay(this.StreamHandle);
        }
Ejemplo n.º 7
0
 public static (SyncProcedure proc, IntPtr user) CreateProcedure(SyncProcedure proc, IntPtr user = default(IntPtr))
 {
     return(proc, user);
 }
Ejemplo n.º 8
0
 public SyncCallback(SyncProcedure proc)
 {
     Sync = proc;
 }
Ejemplo n.º 9
0
 public int ChannelSetSync(IBassAudioChannel channel, SyncFlags type, long parameter, SyncProcedure procedure, IntPtr user = default)
 => BassMix.ChannelSetSync(channel.Handle, type, parameter, procedure, user);
Ejemplo n.º 10
0
 public BassPlayerEngine(bool isMobile)
 {
     Init(isMobile);
     _sync    = EndSync;
     _posSync = PositonReachedSync;
 }
Ejemplo n.º 11
0
 public CoreBreadPlayer()
 {
     Init();
     _sync    = new SyncProcedure(EndSync);
     _posSync = new SyncProcedure(PositonReachedSync);
 }
Ejemplo n.º 12
0
 public static extern int ChannelSetSync(int Handle, SyncFlags Type, long Param, SyncProcedure Procedure, IntPtr User = default(IntPtr));
Ejemplo n.º 13
0
 public ReferenceHolder()
 {
     _freeproc = Callback;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 protected Effect()
 {
     _syncProcedure = (a, b, c, d) => Dispose();
 }
Ejemplo n.º 15
0
 public CoreBreadPlayer()
 {
     Init();
     _sync = new SyncProcedure(EndSync);
 }
Ejemplo n.º 16
0
 public MacalifaPlayer()
 {
     Init();
     _sync = new SyncProcedure(EndSync);
 }
Ejemplo n.º 17
0
 public static extern int MixerChannelSetSync(int handle, int type, long param, SyncProcedure proc, IntPtr user);