mirror of
https://github.com/fltk/fltk.git
synced 2026-06-07 00:55:23 +08:00
Remove Fl::*sleep() method family, as discussed in fltk.coredev.
Hopefully this doesn't break Windows or Mac OX IDE builds, please help
testing.
Short story: these functions showed compatibility problems, lacked some
quality (regarding interruption by signals), and maybe more.
This is a combined commit that reverts three (3) svn commits. The following
lists are extracted from git, but show the svn revisions and files:
Remove Fl::*sleep() family, part 1: revert svn r 10287.
:100644 100644 a988702... 794920f... M ide/Xcode4/FLTK.xcodeproj/project.pbxproj
Remove Fl::*sleep() family, part 2: revert svn r 10151.
:100644 100644 cf839e6... bfde9c4... M ide/Xcode3/FLTK.xcodeproj/project.pbxproj
:100644 100644 794920f... c0c772a... M ide/Xcode4/FLTK.xcodeproj/project.pbxproj
Remove Fl::*sleep() family, part 2b: revert svn r 10151 (continued).
:100644 100644 bfde9c4... abf2922... M ide/Xcode3/FLTK.xcodeproj/project.pbxproj
Remove Fl::*sleep() family, part 3: revert svn r 10150.
:100644 100644 b469018... e76a3e5... M FL/Fl.H
:100644 100644 7bb7899... 4d4755d... M ide/VisualC2008/fltk.lib.vcproj
:100644 100644 9d9a2cf... 334aef8... M ide/VisualC2008/fltkdll.vcproj
:100644 100644 5533a54... e30058b... M ide/VisualC2010/fltk.lib.vcxproj
:100644 100644 e49f691... 1259c87... M ide/VisualC2010/fltk.lib.vcxproj.filters
:100644 100644 946f31a... d53ab80... M src/CMakeLists.txt
:100644 000000 fed36fd... 0000000... D src/Fl_sleep.cxx
:100644 100644 3d9656c... 3b265f9... M src/Makefile
:100644 100644 6eadbcb... 5dd5872... M test/sudoku.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10419 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+8
-8
@@ -418,19 +418,19 @@ SudokuSound::audio_cb(AudioDeviceID device,
|
||||
}
|
||||
#endif // __APPLE__
|
||||
|
||||
#define NOTE_DURATION_MS 50
|
||||
#define NOTE_DURATION 50
|
||||
|
||||
// Play a note for 250ms...
|
||||
// Play a note for <NOTE_DURATION> ms...
|
||||
void SudokuSound::play(char note) {
|
||||
Fl::check();
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Point to the next note...
|
||||
data = sample_data[note - 'A'];
|
||||
remaining = sample_size * 2;
|
||||
|
||||
// Wait for the sound to complete...
|
||||
Fl::msleep(NOTE_DURATION_MS);
|
||||
usleep(NOTE_DURATION*1000);
|
||||
|
||||
#elif defined(WIN32)
|
||||
if (sample_size) {
|
||||
@@ -438,8 +438,8 @@ void SudokuSound::play(char note) {
|
||||
|
||||
waveOutWrite(device, header_ptr, sizeof(WAVEHDR));
|
||||
|
||||
Fl::msleep(NOTE_DURATION_MS);
|
||||
} else Beep(frequencies[note - 'A'], NOTE_DURATION_MS);
|
||||
Sleep(NOTE_DURATION);
|
||||
} else Beep(frequencies[note - 'A'], NOTE_DURATION);
|
||||
|
||||
#else
|
||||
# ifdef HAVE_ALSA_ASOUNDLIB_H
|
||||
@@ -449,7 +449,7 @@ void SudokuSound::play(char note) {
|
||||
snd_pcm_prepare(handle);
|
||||
snd_pcm_writei(handle, sample_data[note - 'A'], sample_size);
|
||||
}
|
||||
Fl::msleep(NOTE_DURATION_MS);
|
||||
usleep(NOTE_DURATION*1000);
|
||||
return;
|
||||
}
|
||||
# endif // HAVE_ALSA_ASOUNDLIB_H
|
||||
@@ -464,7 +464,7 @@ void SudokuSound::play(char note) {
|
||||
// Sound a tone for the given note...
|
||||
control.bell_percent = 100;
|
||||
control.bell_pitch = frequencies[note - 'A'];
|
||||
control.bell_duration = NOTE_DURATION_MS;
|
||||
control.bell_duration = NOTE_DURATION;
|
||||
|
||||
XChangeKeyboardControl(fl_display,
|
||||
KBBellPercent | KBBellPitch | KBBellDuration,
|
||||
|
||||
Reference in New Issue
Block a user