On Thursday 16 January 2003 21:08, Brian Victor wrote:
> I've removed all attachments to wxWindows, so anyone should be able to
> compile my test program.  So I don't have to keep sending snippits out
> of context, the code is here:
>
> http://www.personal.psu.edu/users/b/h/bhv1/nowx.cc      or
> http://www.personal.psu.edu/users/b/h/bhv1/nowx.cc.html (syntax colored)
> (g++ nowx.cc -o nowx -lasound)

In short: start the queue before sending events, add snd_seq_drain_output at 
end of SetTempo method.

I wrote some example programs in plain C while learning ALSA API (player, 
recorder, metronome, monitor...)
http://perso.wanadoo.es/plcl/alsautil.tar.bz2

More examples, for Kylix and FreePascal:
http://perso.wanadoo.es/plcl/

HTH

--- nowx.cc.old Thu Jan 16 22:11:17 2003
+++ nowx.cc     Thu Jan 16 22:08:59 2003
@@ -64,14 +64,14 @@
   wxMidiOutput outport(sequencer);
   wxMidiQueue queue(sequencer);
   int x;
-  for (x = 0; x < 400; ++x)
-  {
-    queue.NoteOn(outport, x, 127, x);
-  }
   cout << "Queue will start in five seconds" << endl;
   sleep(5);
   cout << "Starting queue" << endl;
   queue.StartQueue();
+  for (x = 0; x < 400; ++x)
+  {
+    queue.NoteOn(outport, x , 127, x);
+  }
   while (1) {
     sleep(1);
   }
@@ -181,6 +181,7 @@
   snd_seq_queue_tempo_set_ppq(tpo, 128);
   snd_seq_set_queue_tempo(m_drv.GetAlsaSeq(), m_queue, tpo);
   snd_seq_queue_tempo_free(tpo);
+  snd_seq_drain_output(m_drv.GetAlsaSeq());
 }

 void wxMidiQueue::StartQueue()



-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to