19 Jun '13 - 19:12 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: SYNCing on Bass.BASS_ChannelSetPosition  (Read 1058 times)
JJS
Posts: 102


« on: 25 Oct '08 - 18:28 »
Reply with quoteQuote

Is it possible to set up a sync that is called whenever BASS_ChannelSetPosition is called on a stream?

Is it possible to set up more that one syncproc for a given sync? (like a .NET event)


-JJS
Logged
radio42
Posts: 4030


« Reply #1 on: 26 Oct '08 - 10:44 »
Reply with quoteQuote

Yes. The sync you are looking for is the BASS_SYNC_SETPOS.

For a certain sync there is obviously only one SYNCPROC, but you can of course define multiple sync's on the same streams with different SYNCPROCs.
Logged
JJS
Posts: 102


« Reply #2 on: 26 Oct '08 - 18:52 »
Reply with quoteQuote

I'm not sure what you mean.

I have a class called MidiStreamEvent. I create an instance of a MidiStreamEvent-derived class for each BASSMIDIEvent that I'm interested in (program changes, reverb, chorus, tempo and so on).

The MidiStreamEvent class encapsulates the SYNCPROC,  the .NET events to keep the UI updated, and variables so that the user can override the particular MIDI parameter, and enable or disable the override on-the-fly.

When a stream is created, I "connect" the stream to the MidiStreamEvent objects. 

Recall that to override a midi parameter, you must call  BASS_MIDI_StreamEvent() in the syncproc, and when changing position, you must call BASS_MIDI_StreamEvent manually.

This design greatly simplifies adding BASSMIDIEvent managers to my app. To further simplify my app, I want each MidiStreamEvent object to have it's own setpos and streamfree sync, so that it can internally keep itself updated as external events occur.

I coded it this way to test my concept, and it seems to work. Each MidiStreamEvent object (currently, there are 20) has it's own setpos and streamfree sync.

-JJS





Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines