Exemple #1
0
        //druga himna
        void output_PlaybackStopped(object sender, NAudio.Wave.StoppedEventArgs e)
        {
            if (notClosed)
            {
                try
                {
                    DisposeWave();

                    byte[]                 gostPesma  = AuxLib.LoadSoundFromGridFS(gost.Ime + "himna");
                    MemoryStream           gostStream = new MemoryStream(gostPesma);
                    NAudio.Wave.WaveStream pcm        = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(new NAudio.Wave.Mp3FileReader(gostStream));
                    stream = new NAudio.Wave.BlockAlignReductionStream(pcm);


                    output = new NAudio.Wave.DirectSoundOut();
                    output.Init(stream);

                    output.Play();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
            }
        }
Exemple #2
0
        private void FInfoZaMec_Load(object sender, EventArgs e)
        {
            try
            {
                //TO DO : UCITATI I FORMATIRATI INFORMACIJE O OBA TIMA I O STADIONU I UPISATI U RTB..
                //prvo za domacina
                AuxLib.PrikaziDomacinaRTB(RTBDomacinInfo, domacin.Ime);
                AuxLib.PrikaziGostaRTB(RTBGostInfo, gost.Ime);
                AuxLib.PrikaziStadionRTB(RTBStadionInfo, stadion.Ime);



                //-------------------------

                //ucitavanje slika iz gridFS-a
                this.PBDomacinZastava.Image = AuxLib.LoadImageFromGridFS(domacin.Ime + "zastava");
                this.PBGostZastava.Image    = AuxLib.LoadImageFromGridFS(gost.Ime + "zastava");
                this.PBStadionZastava.Image = AuxLib.LoadImageFromGridFS(stadion.Ime + "stadion");
                //--------------------------

                //ucitamo himnu iz baze kao byte array
                byte[] domacinPesma = AuxLib.LoadSoundFromGridFS(domacin.Ime + "himna");
                //napravis stream
                MemoryStream domacinStream = new MemoryStream(domacinPesma);
                //prekines ako ima neka pesma prethodno ( za svaki slucaj );
                DisposeWave();
                //pcm pd strima
                NAudio.Wave.WaveStream pcm = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(new NAudio.Wave.Mp3FileReader(domacinStream));
                stream = new NAudio.Wave.BlockAlignReductionStream(pcm);

                //init,hendler za drugu himnu i play
                output = new NAudio.Wave.DirectSoundOut();
                output.Init(stream);
                output.PlaybackStopped += output_PlaybackStopped;
                output.Play();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }
Exemple #3
0
        private void FInfoZaMec_Load(object sender, EventArgs e)
        {
            try
            {
                //vraca vraca objekte i upisuje podatke u richtextboxove
                domacin = AuxLib.PrikaziDomacinaRTB(this.RTBDomacinInfo, domacinIme);
                gost    = AuxLib.PrikaziDomacinaRTB(this.RTBGostInfo, gostIme);
                stadion = AuxLib.PrikaziStadionRTB(this.RTBStadionInfo, domacin);
                //-------------------------

                //ucitavanje slika iz gridFS-a
                this.PBDomacinZastava.Image = AuxLib.LoadImageFromGridFS(this.domacinIme + "zastava");
                this.PBGostZastava.Image    = AuxLib.LoadImageFromGridFS(this.gostIme + "zastava");
                this.PBStadionZastava.Image = AuxLib.LoadImageFromGridFS(stadion.Ime + "stadion");
                //--------------------------

                //ucitamo himnu iz baze kao byte array
                byte[] domacinPesma = AuxLib.LoadSoundFromGridFS(domacinIme + "himna");
                //napravis stream
                MemoryStream domacinStream = new MemoryStream(domacinPesma);
                //prekines ako ima neka pesma prethodno ( za svaki slucaj );
                DisposeWave();
                //pcm pd strima
                NAudio.Wave.WaveStream pcm = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(new NAudio.Wave.Mp3FileReader(domacinStream));
                stream = new NAudio.Wave.BlockAlignReductionStream(pcm);

                //init,hendler za drugu himnu i play
                output = new NAudio.Wave.DirectSoundOut();
                output.Init(stream);
                output.PlaybackStopped += output_PlaybackStopped;
                output.Play();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }