| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // | 46 // |
| 47 // The state can only transition to the next state, except for the FINISHED_
STATE which can | 47 // The state can only transition to the next state, except for the FINISHED_
STATE which can |
| 48 // never be changed. | 48 // never be changed. |
| 49 enum PlaybackState { | 49 enum PlaybackState { |
| 50 // These must be defined with the same names and values as in the .idl f
ile. | 50 // These must be defined with the same names and values as in the .idl f
ile. |
| 51 UNSCHEDULED_STATE = 0, | 51 UNSCHEDULED_STATE = 0, |
| 52 SCHEDULED_STATE = 1, | 52 SCHEDULED_STATE = 1, |
| 53 PLAYING_STATE = 2, | 53 PLAYING_STATE = 2, |
| 54 FINISHED_STATE = 3 | 54 FINISHED_STATE = 3 |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 AudioScheduledSourceNode(AudioContext*, float sampleRate); | 57 AudioScheduledSourceNode(AudioContext*, float sampleRate); |
| 58 | 58 |
| 59 // Scheduling. | 59 // Scheduling. |
| 60 void start(double when); | 60 void start(double when); |
| 61 void stop(double when); | 61 void stop(double when); |
| 62 | 62 |
| 63 // un-hide the ActiveDOMElement stop |
| 64 using AudioSourceNode::stop; |
| 65 |
| 63 #if ENABLE(LEGACY_WEB_AUDIO) | 66 #if ENABLE(LEGACY_WEB_AUDIO) |
| 64 void noteOn(double when); | 67 void noteOn(double when); |
| 65 void noteOff(double when); | 68 void noteOff(double when); |
| 66 #endif | 69 #endif |
| 67 | 70 |
| 68 unsigned short playbackState() const { return static_cast<unsigned short>(m_
playbackState); } | 71 unsigned short playbackState() const { return static_cast<unsigned short>(m_
playbackState); } |
| 69 bool isPlayingOrScheduled() const { return m_playbackState == PLAYING_STATE
|| m_playbackState == SCHEDULED_STATE; } | 72 bool isPlayingOrScheduled() const { return m_playbackState == PLAYING_STATE
|| m_playbackState == SCHEDULED_STATE; } |
| 70 bool hasFinished() const { return m_playbackState == FINISHED_STATE; } | 73 bool hasFinished() const { return m_playbackState == FINISHED_STATE; } |
| 71 | 74 |
| 72 protected: | 75 protected: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 94 // If it hasn't been set explicitly, then the sound will not stop playing (i
f looping) or will stop when the end of the AudioBuffer | 97 // If it hasn't been set explicitly, then the sound will not stop playing (i
f looping) or will stop when the end of the AudioBuffer |
| 95 // has been reached. | 98 // has been reached. |
| 96 double m_endTime; // in seconds | 99 double m_endTime; // in seconds |
| 97 | 100 |
| 98 static const double UnknownTime; | 101 static const double UnknownTime; |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 } // namespace WebCore | 104 } // namespace WebCore |
| 102 | 105 |
| 103 #endif // AudioScheduledSourceNode_h | 106 #endif // AudioScheduledSourceNode_h |
| OLD | NEW |