Conversation
|
@mattn I will create a patch for Make_mvc.mak later. |
|
@mattn Could you import this patch? |
|
@k-takata Will do tonight. Thank you. |
|
I applied review fixes. I noticed that implementing sound_playevent() is bits hard. The reasons are:
|
|
I applied review fixes. I noticed that implementing sound_playevent()
is bits hard. The reasons are:
* mciSendString does not allow alias name like "SystemAlert".
* PlaySound() that can allow filename or "SystemAlert" does not work with callback.
* PlaySound() can not stop sound indivisually.
* "SystemAlert" is embeded in "mcires.dll".
* Windows does not have XDG sound list.
Thanks for working on this. Unfortunately, the list of sound events
that is supported is unclear. There is a list from XDG, e.g. here:
http://0pointer.de/public/sound-naming-spec.html
But it contains many names that my Ubuntu system doesn't have, while the
simple "bell" sound isn't listed.
Does MS-Windows install some of these sounds, so that they can be played
as sound files? Then we could map some event names to them. I rather
not include sound files in the distribution, except some very basic ones
like "bell". I assume plugins can include files in a way they play on
any system with the +sound feature. .wav files should work, libcanberra
also handles .ogg and other formats.
…--
hundred-and-one symptoms of being an internet addict:
152. You find yourself falling for someone you've never seen or hardly
know, but, boy can he/she TYPE!!!!!!
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Older version of Windows install them. But Windows 10 does not install them. All of sound resource are bundled in mcires.dll as resource file. PlaySound() API can play the resource sound. But PlaySound() is not used with callback as I mentioned in above. |
|
>Does MS-Windows install some of these sounds, so that they can be
>played as sound files? Then we could map some event names to them.
>I rather not include sound files in the distribution, except some
>very basic ones like "bell". I assume plugins can include files in a
>way they play on any system with the +sound feature. .wav files
>should work, libcanberra also handles .ogg and other formats.
Older version of Windows install them. But Windows 10 does not install
them. All of sound resource are bundled in mcires.dll as resource
file. PlaySound() API can play the resource sound. But PlaySound() is
not used with callback as I mentioned in above.
It looks like PlaySound() can play the sound synchronously with SND_SYNC,
thus block until it's finished. If we can do this in a new thread, then
it's possible to invoke the callback when finished. Is that doable?
…--
Although the scythe isn't pre-eminent among the weapons of war, anyone who
has been on the wrong end of, say, a peasants' revolt will know that in
skilled hands it is fearsome.
-- (Terry Pratchett, Mort)
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
I think it is possible, but the problem is that PlaySound() cannot stop the sounds individually. |
Codecov Report
@@ Coverage Diff @@
## master #4522 +/- ##
==========================================
+ Coverage 80.65% 80.82% +0.17%
==========================================
Files 111 111
Lines 143838 144338 +500
==========================================
+ Hits 116011 116662 +651
+ Misses 27827 27676 -151
Continue to review full report at Codecov.
|
|
Implemented sound_playevent() using PlaySound(). sound_playevent() return ID, but this can not be used for sound_stop(). |
|
@mattn Could you check this additional patch? |
* Update document about sound_playevent() on Windows. * Some lines exceeded 80 columns. * Types of some variables were wrong.
|
@mattn AppVeyor is failing. We need to fix the test. |
|
We've done. I think this is ready to be merged. |
Problem: MS-Windows: no sound support.
Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata,
closes vim#4522)
Problem: MS-Windows: no sound support.
Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata,
closes vim/vim#4522)
vim/vim@9b28352
----
"sound" feature is N/A now but this updates "v:versionlong" docs.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No numerical value for the patchlevel. Solution: Add v:versionlong. vim/vim@37df9a4 --- Restore "highest_patch()" solely for "v:versionlong". Copy/paste Test_vvar_scriptversion2() from patch 9.1.1540. It works without ":scriptversion 2". In general, if Vim's test works with ":scriptversion 1", just port it for additional coverage. Co-authored-by: Bram Moolenaar <Bram@vim.org> vim-patch:8.1.1565: MS-Windows: no sound support Problem: MS-Windows: no sound support. Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata, closes vim/vim#4522) vim/vim@9b28352 ---- "sound" feature is N/A now but this updates "v:versionlong" docs. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No numerical value for the patchlevel. Solution: Add v:versionlong. vim/vim@37df9a4 --- Restore "highest_patch()" solely for "v:versionlong". Copy/paste Test_vvar_scriptversion2() from patch 9.1.1540. It works without ":scriptversion 2". In general, if Vim's test works with ":scriptversion 1", just port it for additional coverage. Co-authored-by: Bram Moolenaar <Bram@vim.org> vim-patch:8.1.1565: MS-Windows: no sound support Problem: MS-Windows: no sound support. Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata, closes vim/vim#4522) vim/vim@9b28352 ---- "sound" feature is N/A now but this updates "v:versionlong" docs. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No numerical value for the patchlevel. Solution: Add v:versionlong. vim/vim@37df9a4 Restore "highest_patch()" solely for "v:versionlong". Copy/paste Test_vvar_scriptversion2() from patch 9.1.1540. It works without ":scriptversion 2". In general, if Vim's test works with ":scriptversion 1", just port it for additional coverage. --- vim-patch:8.1.1565: MS-Windows: no sound support Problem: MS-Windows: no sound support. Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata, closes vim/vim#4522) vim/vim@9b28352 ---- "sound" feature is N/A now but this updates "v:versionlong" docs. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No numerical value for the patchlevel. Solution: Add v:versionlong. vim/vim@37df9a4 Restore "highest_patch()" solely for "v:versionlong". Copy/paste Test_vvar_scriptversion2() from patch 9.1.1540. It works without ":scriptversion 2". In general, if Vim's test works with ":scriptversion 1", just port it for additional coverage. --- vim-patch:8.1.1565: MS-Windows: no sound support Problem: MS-Windows: no sound support. Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata, closes vim/vim#4522) vim/vim@9b28352 ---- "sound" feature is N/A now but this updates "v:versionlong" docs. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No numerical value for the patchlevel. Solution: Add v:versionlong. vim/vim@37df9a4 Restore "highest_patch()" solely for "v:versionlong". Copy/paste Test_vvar_scriptversion2() from patch 9.1.1540. It works without ":scriptversion 2". In general, if Vim's test works with ":scriptversion 1", just port it for additional coverage. --- vim-patch:8.1.1565: MS-Windows: no sound support Problem: MS-Windows: no sound support. Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata, closes vim/vim#4522) vim/vim@9b28352 ---- "sound" feature is N/A now but this updates "v:versionlong" docs. Co-authored-by: Bram Moolenaar <Bram@vim.org>
This is work in progress. Current status:
sound_playfile: done
sound_stop: done
sound_clear: done