Bug 1855360 - Fix the skip-if syntax. a=bustage-fix
[gecko.git] / widget / windows / nsSound.h
blobd600b0873acb1c1db887730876b676fc0b3c4ba6
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef __nsSound_h__
8 #define __nsSound_h__
10 #include "nsISound.h"
11 #include "nsIObserver.h"
12 #include "nsIStreamLoader.h"
13 #include "nsCOMPtr.h"
14 #include "mozilla/StaticPtr.h"
16 class nsIThread;
17 class nsIRunnable;
19 class nsSound : public nsISound,
20 public nsIStreamLoaderObserver,
21 public nsIObserver
24 public:
25 nsSound();
26 static already_AddRefed<nsISound> GetInstance();
28 NS_DECL_ISUPPORTS
29 NS_DECL_NSISOUND
30 NS_DECL_NSISTREAMLOADEROBSERVER
31 NS_DECL_NSIOBSERVER
33 private:
34 virtual ~nsSound();
35 void PurgeLastSound();
37 private:
38 nsresult CreatePlayerThread();
40 nsCOMPtr<nsIThread> mPlayerThread;
41 nsCOMPtr<nsIRunnable> mSoundPlayer;
42 bool mInited;
44 static mozilla::StaticRefPtr<nsISound> sInstance;
47 #endif /* __nsSound_h__ */