Hi,
> I'm to blame for most of the code in there, so I had a look at it and
> commented some of the places that were marked appropriately.
Thanks Christoph! I haven't had a look at it yet so I'll let you know if
there's anything else major that needs commenting. A lot of the TODO notes I
left were straight copy and paste without thinking, it was getting late at the
time.
> There'd be two types of server events:
> a) next-event: Need to handle the next MIDI event in the song
> b) command: client->server: Execute this command (start song, stop song,
> etc)
> and we'd have to make sure that at most one event was being executed at a
> time.
Excellent - yes that would be easy with mutexes, etc.
> However, I'd like to point out the possibility of an alternative approach
> (which may have been suggested in the past): Separating the song playing
> from the actual song and event control (akin to what the DOS sound server
> used to do). This would mean:
Yes I think I mentioned before that this is how DirectMusic works on Win32.
Although with that, all of the songs would need to be decoded right at the
start and put into a song library, and I'm not sure if that's exactly what you
mean.
So is what you're saying is decode all the songs on startup, and then just have
what are currently commands in the sound server implemented as events that stop
and start everything? That should make running the sound server (on any
platform) a lot smoother, simpler, and faster as well, as we wouldn't be
dealing with two things at once.
Very impressive Master Plan by the way! :-)
Alex.
> SCI sound API <---> Internal on-demand song position counter,
> event calculator etc. (song logic)
> ^ ^
> | \____--> General MIDI file creation
> |
> v
> Sound server API (start, stop, set_options,
> get_type (GM/MT-32(*)/Adlib(*) etc.), set_patch,
> set_callback)
> ^ ^ ^
> | | |
> | | |
> v v v
> External sound Native OS soundserver_unix
> player (play- sound API soundserver_sdl
> midi, timidity) (MacOS) ^
> |
> |
> _______________________________________________/
> |
> +-> midi_mt32 <---> midiout_unixraw, midiout_alsaraw, ...
> |
> +-> midi_gm <---> midiout_win32mci, midiout_unixraw, ...
> |
> +-> midi_adlib <---> midiout_ossseq, midiout_opl3emu, ...
> | ^
> . |
> . |
> . |
> v
> PCM sound driver
> subsystem
>
>
> (*): Using Sierra's MIDI format
> This, ladies and gentlemen, is the Master Plan. Well, it could be,
> anyway...
>
> Essentially, this would involve stripping out the logic from
> sci0_soundserver() and putting it into the part marked as the "song logic"
> part on the slide. Everything else would be pretty much unchanged, except
> for the sound_server_t API being cleaned up to the bare necessities and
> GM data generation being fixed for non-GNU useage.
> Although I might be missing something.
>
>
> llap,
> Christoph
>
>