mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
More accurate names for .started and .stopped
This commit is contained in:
parent
afb824e09c
commit
40641ac8a4
2 changed files with 11 additions and 11 deletions
|
@ -18,8 +18,8 @@ use task_source::{TaskSource, TaskSourceName};
|
|||
#[dom_struct]
|
||||
pub struct AudioScheduledSourceNode {
|
||||
node: AudioNode,
|
||||
started: Cell<bool>,
|
||||
stopped: Cell<bool>,
|
||||
has_start: Cell<bool>,
|
||||
has_stop: Cell<bool>,
|
||||
}
|
||||
|
||||
impl AudioScheduledSourceNode {
|
||||
|
@ -39,8 +39,8 @@ impl AudioScheduledSourceNode {
|
|||
number_of_inputs,
|
||||
number_of_outputs,
|
||||
)?,
|
||||
started: Cell::new(false),
|
||||
stopped: Cell::new(false),
|
||||
has_start: Cell::new(false),
|
||||
has_stop: Cell::new(false),
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,8 @@ impl AudioScheduledSourceNode {
|
|||
&self.node
|
||||
}
|
||||
|
||||
pub fn started(&self) -> bool {
|
||||
self.started.get()
|
||||
pub fn has_start(&self) -> bool {
|
||||
self.has_start.get()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ impl AudioScheduledSourceNodeMethods for AudioScheduledSourceNode {
|
|||
return Err(Error::Range("'when' must be a positive value".to_owned()));
|
||||
}
|
||||
|
||||
if self.started.get() || self.stopped.get() {
|
||||
if self.has_start.get() || self.has_stop.get() {
|
||||
return Err(Error::InvalidState);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ impl AudioScheduledSourceNodeMethods for AudioScheduledSourceNode {
|
|||
AudioScheduledSourceNodeMessage::RegisterOnEndedCallback(callback),
|
||||
));
|
||||
|
||||
self.started.set(true);
|
||||
self.has_start.set(true);
|
||||
self.node
|
||||
.message(AudioNodeMessage::AudioScheduledSourceNode(
|
||||
AudioScheduledSourceNodeMessage::Start(*when),
|
||||
|
@ -107,10 +107,10 @@ impl AudioScheduledSourceNodeMethods for AudioScheduledSourceNode {
|
|||
return Err(Error::Range("'when' must be a positive value".to_owned()));
|
||||
}
|
||||
|
||||
if !self.started.get() {
|
||||
if !self.has_start.get() {
|
||||
return Err(Error::InvalidState);
|
||||
}
|
||||
self.stopped.set(true);
|
||||
self.has_stop.set(true);
|
||||
self.node
|
||||
.message(AudioNodeMessage::AudioScheduledSourceNode(
|
||||
AudioScheduledSourceNodeMessage::Stop(*when),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue