зеркало из https://github.com/mozilla/gecko-dev.git
change sound interface to use an nsIFileSpec* instead of a const char*
This commit is contained in:
Родитель
3b796b29aa
Коммит
061e45aeec
|
@ -83,9 +83,9 @@ EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
|||
MODULE = raptor
|
||||
XPIDL_MODULE = widget
|
||||
|
||||
XPIDLSRCS = \
|
||||
nsIFileSpecWithUI.idl \
|
||||
nsISound.idl \
|
||||
XPIDLSRCS = \
|
||||
nsIFileSpecWithUI.idl \
|
||||
nsISound.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
|
|
@ -17,13 +17,14 @@
|
|||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIFileSpec.idl"
|
||||
|
||||
[scriptable, uuid(B148EED1-236D-11d3-B35C-00A0CC3C1CDE)]
|
||||
interface nsISound : nsISupports
|
||||
{
|
||||
void Init();
|
||||
|
||||
void Play(in string filename);
|
||||
void Play(in nsIFileSpec filespec);
|
||||
// void Stop();
|
||||
|
||||
void Beep();
|
||||
|
|
|
@ -65,7 +65,7 @@ NS_METHOD nsSound::Beep()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsSound::Play(const char *filename)
|
||||
NS_METHOD nsSound::Play(nsIFileSpec *filespec)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsSound::Play");
|
||||
return NS_OK;
|
||||
|
|
|
@ -33,7 +33,7 @@ class nsSound : public nsISound {
|
|||
|
||||
NS_IMETHOD Init(void);
|
||||
|
||||
NS_IMETHOD Play(const char *filename);
|
||||
NS_IMETHOD Play(nsIFileSpec *filespec);
|
||||
|
||||
NS_IMETHOD Beep(void);
|
||||
|
||||
|
|
|
@ -102,13 +102,19 @@ NS_METHOD nsSound::Beep()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsSound::Play(const char *filename)
|
||||
NS_METHOD nsSound::Play(nsIFileSpec *filespec)
|
||||
{
|
||||
if (lib)
|
||||
{
|
||||
char *filename;
|
||||
filespec->GetNativePath(&filename);
|
||||
|
||||
g_print("there are some issues with playing sound right now, but this should work\n");
|
||||
EsdPlayFileType EsdPlayFile = (EsdPlayFileType) PR_FindSymbol(lib, "esd_play_file");
|
||||
(*EsdPlayFile)("mozilla", filename, 1);
|
||||
|
||||
nsCRT::free(filename);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -33,7 +33,7 @@ class nsSound : public nsISound {
|
|||
|
||||
NS_IMETHOD Init(void);
|
||||
|
||||
NS_IMETHOD Play(const char *filename);
|
||||
NS_IMETHOD Play(nsIFileSpec *filespec);
|
||||
|
||||
NS_IMETHOD Beep(void);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ NS_METHOD nsSound::Beep()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsSound::Play(const char *filename)
|
||||
NS_METHOD nsSound::Play(nsIFileSpec *filespec)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("nsSound::Play");
|
||||
return NS_OK;
|
||||
|
|
|
@ -33,7 +33,7 @@ class nsSound : public nsISound {
|
|||
|
||||
NS_IMETHOD Init(void);
|
||||
|
||||
NS_IMETHOD Play(const char *filename);
|
||||
NS_IMETHOD Play(nsIFileSpec *filespec);
|
||||
|
||||
NS_IMETHOD Beep(void);
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ NS_METHOD nsSound::Beep()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsSound::Play(const char *filename)
|
||||
NS_METHOD nsSound::Play(nsIFileSpec *filespec)
|
||||
{
|
||||
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsSound::Play - Not Implemented\n"));
|
||||
NS_NOTYETIMPLEMENTED("nsSound::Play");
|
||||
|
|
|
@ -31,7 +31,7 @@ class nsSound : public nsISound {
|
|||
|
||||
NS_IMETHOD Init(void);
|
||||
|
||||
NS_IMETHOD Play(const char *filename);
|
||||
NS_IMETHOD Play(nsIFileSpec *filespec);
|
||||
|
||||
NS_IMETHOD Beep(void);
|
||||
|
||||
|
|
|
@ -65,9 +65,15 @@ NS_METHOD nsSound::Beep()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsSound::Play(const char *filename)
|
||||
NS_METHOD nsSound::Play(nsIFileSpec *filespec)
|
||||
{
|
||||
char *filename;
|
||||
filespec->GetNativePath(&filename);
|
||||
|
||||
::PlaySound(filename, nsnull, SND_FILENAME | SND_NODEFAULT | SND_ASYNC);
|
||||
|
||||
nsCRT::free(filename);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class nsSound : public nsISound {
|
|||
|
||||
NS_IMETHOD Init(void);
|
||||
|
||||
NS_IMETHOD Play(const char *filename);
|
||||
NS_IMETHOD Play(nsIFileSpec *filespec);
|
||||
|
||||
NS_IMETHOD Beep(void);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче