-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of MIDI playback.
- Loading branch information
Showing
7 changed files
with
91 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,5 +107,5 @@ | |
</ListView> | ||
</DockPanel> | ||
</Grid> | ||
</DockPanel> | ||
</DockPanel> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using TomiSoft.MP3Player.MediaInformation; | ||
using TomiSoft.MP3Player.Utils; | ||
using Un4seen.Bass.AddOn.Midi; | ||
|
||
namespace TomiSoft.MP3Player.Playback.BASS { | ||
class LocalMidiFilePlayback : LocalAudioFilePlayback { | ||
public LocalMidiFilePlayback(string Filename, string SoundfontFilename) : base(Filename) { | ||
this.ApplySoundfontToStream(SoundfontFilename); | ||
} | ||
|
||
public LocalMidiFilePlayback(UnmanagedStream MediaStream, ISongInfo SongInfo, string SoundfontFilename) | ||
: base(MediaStream, SongInfo) { | ||
this.ApplySoundfontToStream(SoundfontFilename); | ||
} | ||
|
||
private void ApplySoundfontToStream(string SoundfontFilename) { | ||
int FontHandle = BassMidi.BASS_MIDI_FontInit(SoundfontFilename); | ||
if (FontHandle != 0) { | ||
BASS_MIDI_FONT Font = new BASS_MIDI_FONT(FontHandle, -1, 0); | ||
|
||
BassMidi.BASS_MIDI_StreamSetFonts(this.ChannelID, new BASS_MIDI_FONT[] { Font }, 1); // apply it to the stream | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters