Updated the example to be compatible with the BASS 2.4 API.

This commit is contained in:
Erik Faye-Lund 2008-09-30 11:37:14 +00:00
parent 59f8089094
commit 4d601c31b0

View File

@ -23,9 +23,9 @@ public:
// BASS hooks // BASS hooks
void pause() { BASS_ChannelPause(stream); } void pause() { BASS_ChannelPause(stream); }
void play() { BASS_ChannelPlay(stream, false); } void play() { BASS_ChannelPlay(stream, false); }
float getTime() { return BASS_ChannelBytes2Seconds(stream, BASS_ChannelGetPosition(stream)); } float getTime() { return float(BASS_ChannelBytes2Seconds(stream, BASS_ChannelGetPosition(stream, BASS_POS_BYTE))); }
float getRow() { return float(getTime() * rowRate); } float getRow() { return float(getTime() * rowRate); }
void setRow(float row) { BASS_ChannelSetPosition(stream, BASS_ChannelSeconds2Bytes(stream, float(row / rowRate))); } void setRow(float row) { BASS_ChannelSetPosition(stream, BASS_ChannelSeconds2Bytes(stream, float(row / rowRate)), BASS_POS_BYTE); }
bool isPlaying() { return (BASS_ChannelIsActive(stream) == BASS_ACTIVE_PLAYING); } bool isPlaying() { return (BASS_ChannelIsActive(stream) == BASS_ACTIVE_PLAYING); }
private: private:
HSTREAM stream; HSTREAM stream;
@ -126,7 +126,7 @@ int main(int argc, char *argv[])
device->EndScene(); device->EndScene();
device->Present(0, 0, 0, 0); device->Present(0, 0, 0, 0);
BASS_Update(); // decrease the chance of missing vsync BASS_Update(0); // decrease the chance of missing vsync
MSG msg; MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{ {