1999-07-23 09:15:58 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-07-23 09:15:58 +04:00
|
|
|
|
|
|
|
#ifndef __nsSound_h__
|
|
|
|
#define __nsSound_h__
|
|
|
|
|
|
|
|
#include "nsISound.h"
|
2017-06-08 06:08:49 +03:00
|
|
|
#include "nsIObserver.h"
|
2000-06-04 11:13:40 +04:00
|
|
|
#include "nsIStreamLoader.h"
|
2013-09-19 17:54:39 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2017-06-08 06:08:49 +03:00
|
|
|
#include "mozilla/StaticPtr.h"
|
2013-09-19 17:54:39 +04:00
|
|
|
|
|
|
|
class nsIThread;
|
1999-07-23 09:15:58 +04:00
|
|
|
|
2017-06-08 06:08:49 +03:00
|
|
|
class nsSound : public nsISound,
|
|
|
|
public nsIStreamLoaderObserver,
|
|
|
|
public nsIObserver
|
1999-07-23 09:15:58 +04:00
|
|
|
|
2000-06-04 11:13:40 +04:00
|
|
|
{
|
2017-06-08 06:08:49 +03:00
|
|
|
public:
|
1999-07-23 09:15:58 +04:00
|
|
|
nsSound();
|
2017-06-08 06:08:49 +03:00
|
|
|
static already_AddRefed<nsISound> GetInstance();
|
2000-06-04 11:13:40 +04:00
|
|
|
|
1999-07-23 09:15:58 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
1999-08-21 12:54:47 +04:00
|
|
|
NS_DECL_NSISOUND
|
2000-06-04 11:13:40 +04:00
|
|
|
NS_DECL_NSISTREAMLOADEROBSERVER
|
2017-06-08 06:08:49 +03:00
|
|
|
NS_DECL_NSIOBSERVER
|
2001-08-30 02:31:38 +04:00
|
|
|
|
|
|
|
private:
|
2014-07-16 00:37:58 +04:00
|
|
|
virtual ~nsSound();
|
2001-08-30 02:31:38 +04:00
|
|
|
void PurgeLastSound();
|
|
|
|
|
|
|
|
private:
|
2017-06-08 06:08:49 +03:00
|
|
|
nsresult CreatePlayerThread();
|
|
|
|
|
2009-07-07 05:47:08 +04:00
|
|
|
nsCOMPtr<nsIThread> mPlayerThread;
|
2017-06-08 06:08:49 +03:00
|
|
|
bool mInited;
|
|
|
|
|
|
|
|
static mozilla::StaticRefPtr<nsISound> sInstance;
|
1999-07-23 09:15:58 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __nsSound_h__ */
|