OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 30 matching lines...) Expand all Loading... |
41 class RTCPeerConnectionHandler; | 41 class RTCPeerConnectionHandler; |
42 | 42 |
43 class RTCDTMFSender : public RefCounted<RTCDTMFSender>, public ScriptWrappable,
public EventTarget, public RTCDTMFSenderHandlerClient, public ActiveDOMObject { | 43 class RTCDTMFSender : public RefCounted<RTCDTMFSender>, public ScriptWrappable,
public EventTarget, public RTCDTMFSenderHandlerClient, public ActiveDOMObject { |
44 public: | 44 public: |
45 static PassRefPtr<RTCDTMFSender> create(ScriptExecutionContext*, RTCPeerConn
ectionHandler*, PassRefPtr<MediaStreamTrack>, ExceptionState&); | 45 static PassRefPtr<RTCDTMFSender> create(ScriptExecutionContext*, RTCPeerConn
ectionHandler*, PassRefPtr<MediaStreamTrack>, ExceptionState&); |
46 ~RTCDTMFSender(); | 46 ~RTCDTMFSender(); |
47 | 47 |
48 bool canInsertDTMF() const; | 48 bool canInsertDTMF() const; |
49 MediaStreamTrack* track() const; | 49 MediaStreamTrack* track() const; |
50 String toneBuffer() const; | 50 String toneBuffer() const; |
51 long duration() const { return m_duration; } | 51 int duration() const { return m_duration; } |
52 long interToneGap() const { return m_interToneGap; } | 52 int interToneGap() const { return m_interToneGap; } |
53 | 53 |
54 void insertDTMF(const String& tones, ExceptionState&); | 54 void insertDTMF(const String& tones, ExceptionState&); |
55 void insertDTMF(const String& tones, long duration, ExceptionState&); | 55 void insertDTMF(const String& tones, int duration, ExceptionState&); |
56 void insertDTMF(const String& tones, long duration, long interToneGap, Excep
tionState&); | 56 void insertDTMF(const String& tones, int duration, int interToneGap, Excepti
onState&); |
57 | 57 |
58 DEFINE_ATTRIBUTE_EVENT_LISTENER(tonechange); | 58 DEFINE_ATTRIBUTE_EVENT_LISTENER(tonechange); |
59 | 59 |
60 // EventTarget | 60 // EventTarget |
61 virtual const AtomicString& interfaceName() const OVERRIDE; | 61 virtual const AtomicString& interfaceName() const OVERRIDE; |
62 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; | 62 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; |
63 | 63 |
64 // ActiveDOMObject | 64 // ActiveDOMObject |
65 virtual void stop() OVERRIDE; | 65 virtual void stop() OVERRIDE; |
66 | 66 |
(...skipping 10 matching lines...) Expand all Loading... |
77 virtual EventTargetData* eventTargetData() OVERRIDE; | 77 virtual EventTargetData* eventTargetData() OVERRIDE; |
78 virtual EventTargetData* ensureEventTargetData() OVERRIDE; | 78 virtual EventTargetData* ensureEventTargetData() OVERRIDE; |
79 virtual void refEventTarget() OVERRIDE { ref(); } | 79 virtual void refEventTarget() OVERRIDE { ref(); } |
80 virtual void derefEventTarget() OVERRIDE { deref(); } | 80 virtual void derefEventTarget() OVERRIDE { deref(); } |
81 EventTargetData m_eventTargetData; | 81 EventTargetData m_eventTargetData; |
82 | 82 |
83 // RTCDTMFSenderHandlerClient | 83 // RTCDTMFSenderHandlerClient |
84 virtual void didPlayTone(const String&) OVERRIDE; | 84 virtual void didPlayTone(const String&) OVERRIDE; |
85 | 85 |
86 RefPtr<MediaStreamTrack> m_track; | 86 RefPtr<MediaStreamTrack> m_track; |
87 long m_duration; | 87 int m_duration; |
88 long m_interToneGap; | 88 int m_interToneGap; |
89 | 89 |
90 OwnPtr<RTCDTMFSenderHandler> m_handler; | 90 OwnPtr<RTCDTMFSenderHandler> m_handler; |
91 | 91 |
92 bool m_stopped; | 92 bool m_stopped; |
93 | 93 |
94 Timer<RTCDTMFSender> m_scheduledEventTimer; | 94 Timer<RTCDTMFSender> m_scheduledEventTimer; |
95 Vector<RefPtr<Event> > m_scheduledEvents; | 95 Vector<RefPtr<Event> > m_scheduledEvents; |
96 }; | 96 }; |
97 | 97 |
98 } // namespace WebCore | 98 } // namespace WebCore |
99 | 99 |
100 #endif // RTCDTMFSender_h | 100 #endif // RTCDTMFSender_h |
OLD | NEW |